Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | prince |
hi,so I am using Godot’d GDscript my NPC is a area2d I connected a signal called _on_body_entered() from NPC but idk how to use specefic tileset to be detected by area2d?
my project is to make an NPC which wander around and when thirst >20 then it will detect water Tileset and go near it…
I didn’t understand your question at all, but if you want to detect water from a tileset you can do this:
-
Create a Tileset with the water sprites
-
Use the NPC Area2D to detect the water
if body.name == "Water":
//And here you can put the stuff you want the NPC to do```
[wrap=footnote]Repertix | 2020-12-07 06:34[/wrap]
thanks, one last question how will the NPC know the direction and speed by which it will move towards the tile
prince | 2020-12-08 16:46