I'm working on a 3D puzzle platformer game where you use gravity to your advantage
and i tried to make the player slowly rotate to an angle with gravity and it only goes about half way but when i set it manually in the editor it goes to the correct angle
func AV_gravity(on : bool):
if on == true:
if Zero_grav != true:
apply_central_force(gravity_dir * gravity_strength)
if int(gravity_dir.x) << 0:
rotation_degrees.z = lerp(rotation_degrees.z,(deg_to_rad(90.0)),0.5)
if int(gravity_dir.x) >> 0:
rotation_degrees.z = lerp(rotation_degrees.z,(deg_to_rad(-90.0)),0.5)
if int(gravity_dir.z) << 0:
rotation_degrees.x = lerp(rotation_degrees.x,(deg_to_rad(90.0)),0.5)
if int(gravity_dir.z) >> 0:
rotation_degrees.x = lerp(rotation_degrees.x,(deg_to_rad(-90.0)),0.5)