Platform Builder Forums
Help and Support => Working with Platform Builder => Topic started by: Wizard Indie Games on July 03, 2020, 09:33:26 AM
-
Is it possible to check the distance between the player and an enemy? I want the enemy to detonate himself when he is close enough to the player.
-
Yeah, that's possible.
In the character settings, set death to detonate. And then in the looping command prompt, put this:
if distance to character 1 < 50
kill enemy
Change "1" to the character ID for your main character.
Change "50" to your desired distance.
I just noticed that "if distance to" is not in the list of conditionals on the website. I'll fix that...
-
Cool. Thanks very much!