Hello. I'm trying to make a game where character movement in the four directions. I managed to move him. But him not have collision with other bodies (tiles, kinematics). I'll show images of the Scripts for you to
help me
Collision with Kinematic Body 2d
It looks like you are using a tile map for collisions, so I’m guessing your player is not colliding with the tiles?
I would guess it’s a problem with your how you’ve setup the tile map, though I could be wrong. Have you looked at the kinematic character demo? Maybe it will help you find the source of your problem.
He is not colliding with any body. I don't know what are the character demo. Can you explain me?
Sorry i'm a beginner in Godot haha
He is not colliding with any body
Have you tried making a StaticBody2D
underneath the player? Make sure to have a CollisionShape2D
as a child of the StaticBody2D
node. You'll also need to include a shape in the CollisionShape2D
.
Your player has a CollisionShape2D
right? I didn't think about it before, but that could also be causing your problem.
I don't know what are the character demo. Can you explain me?
You can find the Kinematic character demo in the demos zip on the Godot engine download page. You can find it on the downloads page if you scroll down a little bit, it's a big white button that reads "Demos. Example projects to get you started". Just download the zip, open the Godot project manager, click "scan", and point it to the extracted zip folder. The demo you want to look at is called "Kinematic Character" and has a picture with some purple squares, a white square, and a pink square.
(On an aside: There is no reason to apologize for being a beginner! Everyone has to start somewhere. :smiley: Helping others is what we're here for! Along with sharing progress, projects, assets, and other stuff :wink: )