#Player not colliding with tilemaplayer

1 messages · Page 1 of 1 (latest)

sullen lantern
#

Im making a bullet-hell game with a parrying mechanic. What I'm trying to do is to create walls for the level. The problem is that the player doesn't seem to collide with the walls..

If there's any more details needed just ask

#

here is the collision masks and layers aswell. first is the player and the second is the tilemaplayer

#

please ping me if you want more details or whatnot

weak wren
#

I think you also need a tilemap node as a parent of your tilelayer node.

sullen lantern
blazing geode
#

Did you add a physics layer and collision polygons to all the tiles that should block player movement?

#

Also the video doesn't really show anything, did you capture the wrong window perhaps?

blazing geode
#

Can't see anything obviously wrong with the things you've shown

sullen lantern
#

the move_and_slide() method is causing the weird movement of the player when touching the wall, but removing it just makes the player pass through walls normally

blazing geode
#

Do you have anything else moving the player? e.g. modifying it's position directly

#

Delete this line, I missed it the first time I looked at it

sullen lantern
blazing geode
#

When you set position directly, the node just jumps there instantly. move_and_slide checks for collisions, and the modifies position based on velocity, so you should not combine it with other methods to move the node (usually)

#

But if you ever want to move something without physics, it's usually position = velocity * delta otherwise the unit speed depends on your frame rate