Godot can't see Collision Shapes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GunPoint
:warning: Old Version Published before Godot 3 was released.

Ok so i want to make a platformer game. I made a KinematicBody2D which can move horizontaly. I added to it a collision shape(rectangle) and a sprite.
I made a new scene where i put every tile and assigned to it a RigidBody2D and,
as a child of RigidBody2D, a CollisionPolygon2D modified by me
I did this to every tile in the game.
Converted that scene into a tileset, added to my game a tilemap.
I made the level but i have a major problem. When moving, my character just passes through walls and ground.
Because of that, i added to the world an Area2D node, assigned some CollisionShape2D’s(rectangles) for the ground and the walls. Now the player stops only when colliding to the ground, but passes through walls. Checked if the depth’s are the same and they are.
Strange problem, never happened to me.
(Sorry for my english)

:bust_in_silhouette: Reply From: 807

You do not provide enough information to solve your problem. Try to check if the collision shapes have “trigger check” on or off. Then check in which “physics layers” are the objects that have to collide and which “physics layers” mask. Some of those things should be.

All collision shapes have exactly the same settings.
They are default
What is trigger? Should be on or off? Tried both ways and nothing

GunPoint | 2017-08-14 12:23

:bust_in_silhouette: Reply From: 807

Ok, sorry for the last answer… I still can not imagine your scene.

Other tests:

1- If you are using rigidbodies to make scenary collision objects, probably this invisible objects fall down to the infinite.y position by gravity effect. Put a sprite inside the rigidbodies to test that And if the objects fall down, change “mode” to static or replace with staticbody2D. (put the sprite inside- this is important, if rigitbody is child of any visible object, this object can stay at the place and the rigidbody down, and you don´t notice that)

2-If you are using a Area2D to stop physics movement think that this is not the aim for this node. You should replace the area by a Staticbody2D and it should work. You can put several collisionpolygons inside and if is not “trigger”, it stops kinematicmovement (if layer mask is correct)

Finnaly works. The problem was me xD. For the ground i put StaticBodies and for the walls i put RigidBodies xD.(changed them to static and worked well) That was just my fault.
Thank you! I almost wanted to abandon the project

GunPoint | 2017-08-14 20:12

:bust_in_silhouette: Reply From: manusiatidakbiasa

How about you try changing RigidBody2D to StaticBody2D and see if it works?

Already solved :wink:

GunPoint | 2017-08-15 16:53