- Edited
I am using a RigidBody3D when it falls I want to redirect the force of gravity (linear_velocity.y) in another direction.
For example as soon as the body touches the floor before the physics engine reset the vertical speed I want to assign it to another axis. How can I do it?
I've tried with this, but it doesn't work
func _integrate_forces(state):
for contactIndex in state.get_contact_count():
var normal: Vector3 = state.get_contact_local_normal(contactIndex);
if normal == Vector3.UP:
if linear_velocity.y > 0:
linear_velocity.x += linear_velocity.y;