#How to detect collisions with a certain Tilemmap?

2 messages · Page 1 of 1 (latest)

lament pulsar
#

Hello, I am trying to get an enemy running on a characterbody 2d to turn around whenever it hits a certain wall. Currently i have got the enemy turning based on a random timer from 1 to 4 seconds. I want to be able to do this for other objects and enemies as well. The wall that im using is running on a tilemap with basic collisions. Thank you for your help.

primal bloom
#

You can use "var collission = move_and_collide()" then "if collission" check it if its a wall then reverse yourself