How to stop the ball from going through the platform?

ezgif-7d897c9854798c
when I rotate the red part slowly the white ball doesn’t cross, when I rotate the red part of the hi quickly the white crosses, how do I prevent the white ball from crossing the red part?
The red part behaviors:



the white ball behaviors:

Are you rotating the maze using Physics? Modifying the position or rotation of a Physics body using non-phyics actions will give problems like this.

Also, you shouldn’t mix platforms and Physics behaviours. One or the other, not both.

WELL, MrMen,I think you’re right, I deleted the platforms and used only physics, the ball still goes through the platforms, as you said, maybe, picking the maze with physics is not the right way, now, I’m working on it, as long as the maze pattern can block the ball, it can be solved, at the moment there is no way!

I think using physics is the right way. How have you defined the Physics collision boxes for the maze walls? And do you stretch or scale the walls?

Well,The wall is a red square stretched into a rectangle to fit the map behind it, and everything looks normal, except for the fact that the ball goes through the maze wall when spinning quickly, which is confusing.
pingtai
The wall behaviors:



Here’s where the problem is. You’re rotating the physics object using non-physics actions. It messes up the physics body calculations.

Thank you very much MrMen!I removed the physical body all together and solved the current problem with the simplest PlatformerObject + platform, it’s still a bit imperfect but it’s 80% of the way there, you’re the Master!


1 Like

You could get a better result if you make the walls a little thicker.