Turn enemy off when player is within a certain distance for an amount of time
capitalcarnage
Member Posts: 371
Im not sure if its the Homebrew Cider or just to damn slow to get it tonight but...
I'm working with magnitude to detect a players distance from/to an enemy with no problem but would like to change it up a bit by having the enemy only disappear/die when the player is within say 150pixels of the enemy for 2 seconds before the enemy dies, any shorter and then enemy wont die and the collide with the will kill the player.
Basically I want to avoid the player running full pelt at the enemy and the enemy just disappearing because the player is less than 150 pixels away, I want the player to have to slow down and wait before moving on.
Any thoughts welcome, I feel like its staring me in the face but nothings come through
I'm working with magnitude to detect a players distance from/to an enemy with no problem but would like to change it up a bit by having the enemy only disappear/die when the player is within say 150pixels of the enemy for 2 seconds before the enemy dies, any shorter and then enemy wont die and the collide with the will kill the player.
Basically I want to avoid the player running full pelt at the enemy and the enemy just disappearing because the player is less than 150 pixels away, I want the player to have to slow down and wait before moving on.
Any thoughts welcome, I feel like its staring me in the face but nothings come through
Comments
It will be more efficient if the collide actor has it's visibility switched off rather than making it's alpha channel 0.