#Enemy doesnt collide with walls

5 messages · Page 1 of 1 (latest)

crisp bone
#

I was following the brackeys' tutorial. I am stuck on the enemy part. after I added movement to do slime, it goes through all the walls and doesnt collide, I have added Raycasts and set them to change direction everytime it collides with smth, but it goes right through..

icy parrot
#

if your slime is a characterbody2d, make sure to add a collisionshape2d and make sure player and slime collision layers are detecting the collision layer of ground objects.

balmy kraken
#

According to the tutorial, they are simply Node2D.
Did you modify the raycasts' collision mask? It should look like this :

#

Also, the raycasts need to have their target arrow set just like the tutorial -- one looking left, another looking right, like this (I made the slime looks transparent for visibility's sake) :

crisp bone
#

Thanks a lot guys