So I've been looking around for a while and can't seem to find an answer for this. I am trying to make a game where you stack shapes as high as possible. I have an OnMouseDrag script so I can grab a shape and put it on top of another. but for some reason when I'm dragging a shape, the shapes will just pass right through each other and glitch and start spinning excessively and also passes through other colliders such as the box colliders 2d on both sides of the screen. If anyone could help me I would very much appreciate it. Thank you.
Asked
Active
Viewed 340 times
Transform
component. This is a common error when you want physics-based collisions, because moving with theTransform
completely bypasses the physics engine. If you want the physics engine to have a say in where the objects go, you need to talk to it via yourRigidbody
/Rigidbody2D
component, applying forces/velocities rather than direct position teleporting. – DMGregory Feb 04 '19 at 17:06