How to not add velocity to player when landing on a moving object?

Godot Version

v4.4.1

Question

Hi there! I’m new, and I recently ran into a thing I don’t know how to disable.
When my character lands on a moving surface, it instantly matches the velocity of that surface. I don’t want to disable this, but there are things I want to push in my test world, including a ball. When I push that ball (it is significantly smaller than the player) it rotates, and my player gets “stuck” onto the surface of the ball, accelerating forwards because it is touching the ball. I can solve this problem by changing the values of the max slope angle and behaviour for when leaving a slope, but it still does some weird teleporting stuff when I push it with the velocity adding disabled. I can live with the teleporting, but I would like to disable climbing on only the ball, so the player will slide off with no change in velocity if they try to land on the ball.

Here is a gif of an example of the problem: (I want the player to stay behind the ball)
godot
Here is my GitHub repository with the project:

Note that when you are trying to run the game, you need more than one instance (I haven’t put in the singleplayer yet). On the first one, you need to “host server” and on the second one, you need to “join server”. The server must be hosted before trying to join the server, or you will have to restart the game.

Note that I am looking for a workaround that doesn’t include turning the on leave platform behaviour to “do nothing”.

Thank you all!

Try setting the CharacterBody3D.platform_on_leave to PlataformOnLeave.PLATFORM_ON_LEAVE_DO_NOTHING or unchecking all the CharacterBody3D.platform_floor_layers layers.

This worked, thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.