How to smoothly move rigid bodies 3D up a slope?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By xdrenal

Hi, I’m trying to make a rigid-body player. Everything works as wanted except going up hills. I’ve managed to detect when I’m on a slope by seeing if the contacts normal is not a Vector 3.UP. I just need help smoothly moving the rigid body up a hill and not getting stuck while on its way. Is there any method similar to project on plane from unity? Thanks!

if state.get_contact_count() > 0:
	if move_input:
		if state.get_contact_local_normal(0) != Vector3.UP:
			print("SLOPE")
		else:
			print("NOT A SLOPE")

Did You try to experiment with more spherical collision shapes ? This will be naturally smooth, however You might have to prevent sliding down in code later.

Inces | 2023-07-01 20:00

I’ve already tried, unfortunately I still can’t move across a slope. I’ll provide a video of what I mean

xdrenal | 2023-07-01 20:22

https://youtu.be/BHCT28j7WhQ
that link should work

xdrenal | 2023-07-01 20:29

I see, so it runs smoothly until slope is too high. The problem must lie in the movement code, not in slope detection.

Inces | 2023-07-03 17:54