collision problem

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

I have a problem, I try to make an rpg, but when I add collisions to my character and the map, neither of them collide, my character just goes through the map… and yes, the collision has a shape, but it doesn’t work

Be sure your collision shapes are convex (box, sphere, etc.) and not concave. Godot has very limited support for concave collision shapes.

Also, be sure your moveable objects are rigid bodies or kinematic bodies. If the latter, be sure you are only moving them using the move_and_collide() or move_and_slide() functions. Do not move them by changing their positions directly. If the former, be sure you are moving them using only the rigid body movement functions rather than moving their positions directly. And be sure you are not applying impulses automatically every frame.

Also be sure you are not scaling the collision shapes. Collisions will not work correctly if their shapes are scaled.

I think those are the most common reasons for collisions to fail.

stormreaver | 2023-04-27 16:00

:bust_in_silhouette: Reply From: jvadair

Make sure your 2d object isn’t static - this was my problem :slight_smile:
You can always use a 2d area if you don’t want it to move.

ok I followed your advice, (change the staticbody2d for the 2d area) but my character still doesn’t collide with the limits of the map, he just crosses them, can you help me?

Ronin910 | 2023-04-27 16:02