How to queue a heartbeat to get faster when an enemy is near

IEnumerator heartbeat_function(){ heartbeatsound.play(); delay = vector3.distance(player_position, slender_man_position); //delay = delay / 2 to make it happen twice as much //delay = delay * 2 to make it happen half as much figure out a the right multiplier or divider to get the result you want. if(delay> MAX_SAFE_DELAY) {delay = MAX_SAFE_DELAY } yield WaitForSeconds(delay);}

Simulate the player’s heartbeat when the enemy approaches

Leave a Comment

Your email address will not be published.