#RigidBody falls through rotating MeshInstance

5 messages · Page 1 of 1 (latest)

silk sage
#

I'm working on a simple prototype that has the user rotate the platform in order to lead the ball to the goal. However, when the platform rotates and the ball is near the corners, sometimes the ball ends up just falling through the the mesh. I'm not sure how exactly to solve this since I don't want to impact the game's speed or anything like that.

Here's my rotation code for the stage just in case it helps:
func _physics_process(_delta): if Input.is_action_pressed("TiltU") and self.rotation_degrees.x >= -5: self.rotation_degrees.x -= 5 elif Input.is_action_pressed("TiltD") and self.rotation_degrees.x <= 5: self.rotation_degrees.x += 5 elif Input.is_action_pressed("TiltR") and self.rotation_degrees.z >= -5: self.rotation_degrees.z -= 5 elif Input.is_action_pressed("TiltL") and self.rotation_degrees.z <= 5: self.rotation_degrees.z += 5

silk sage
#

Update: I set the numbers lower and it doesn’t go through the ground fully anymore, but in some cases it gets stuck in the ground and stops.

harsh zenith
#

Is your platform a kinematic body? What if you try rotating in _integrate_forces instead of physics process? (note: you have to act upon the state variable passed to integrate_forces in case you're unfamiliar)

wet lava
#

Physics engines usually struggle with rotating objects. Perhaps dont rotate the platform at all. Get the same effect by moving the camera and changing the direction of gravity while leaving the board exactly where it is

celest tulip
#

me after seeing the ball goes down... "Naawwwwhhhh"