Is there a way where a Kinematic Rigidbody will not be able to pass through other Static rigid body?
I don’t want gravity to affect the player in the game as it is able to fly, but it keeps passing on through other collisions with static rigid body.
I am making a 2d game, and I don’t want the player (Kinematic) to be able to pass through the walls and the platforms which are static.
Kinematic objects work like that, so most likely you need to use a dynamic rigid body.
To cancel gravity you can override the player’s linear velocity and move him directly like that. So instead of using forces you can manipulate its velocity and cancel the effect of the gravity force.
So I tried using dynamic rigid body. I just scratched off the idea of the player being able to fly haha!
So I used applyForces for right and left movement, and applyImpulse for the jump.
However, the whole game gets ruined when I try to move? I don’t know how to explain it but here is a short clip.
I am not sure what am I doing wrong.
And if I am to code using player’s linear velocity, how? I am very much new to all of this, a format or a guide would help! Thank you so much for your time!