2 colliders together and a player gravity.

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

Hi, I am making a 3d game with 2d look, and I have a little trouble.

If I have 2 colliders together, and the player on top of them, the camera player(current), start to shake. How to avoid that?

I read about: velocity = move_and_slide(velocity, Vector3.UP, true), it is having the issue.

:bust_in_silhouette: Reply From: clownshoe

May not be exactly what you’re talking about, but… a problem I ran into in 2D recently, was the KinematicBody2D always interacting in weird ways with any RigidBody2D. If my character landed on a RigidBody2D it would push it through the floor, but in a weird way.
in move_and_slide, if you have infinite_inerta = true (which is by default) try calling the move_and_slide with infinite_inertia=false. This fixed that issue for me.

Vector3 move_and_slide ( Vector3 linear_velocity, Vector3 up_direction=Vector3( 0, 0, 0 ), bool stop_on_slope=false, int max_slides=4, float floor_max_angle=0.785398, bool infinite_inertia=true )