0
votes

I am making a kind of pinball game for learning purpose. Whenever the ball hits the flipper it passes through them. I have made the balls rigidbody2d detection set to continuous but it still isnt working.

2
Are you using a Collider for the flippers? If so, which one are you using?RippStudwell
It is also possible that if the collision boxes for your flippers are too slim and if your ball is moving fast enough, the pinball could be in front of the flipper one frame and behind the flipper the next frame (without either of them overlapping and triggering a collision)RippStudwell
does it work in general if the objects move slow? Here is a very old but maybe still valid workaround for thisderHugo
@RippStudwell yes i was using polygon collider 2d first. When it didnt workout. I decided to use a box collider 2d but the result is still the sameProNoob22
Yes it works if the objects move slow @derHugoProNoob22

2 Answers

1
votes

You should use RigidBody.MoveRotation instead of setting the transform.localRotation. And doing this in FixedUpdate instead of Update

0
votes

You should try using RigidBody.MoveRotation instead of setting the transform.localRotation. And doing this in FixedUpdate instead of Update – Leo Bartkus