I am part of a group creating a game where you have to survive the night in a forest filled with monsters that hunt you. I am in charge of sound. I am currently trying to create a heartbeat sound that gets louder and faster as the monster gets closer using fmod. For this to work, I need to be able to know how close the monster is to the player to determine the speed and volume of the heartbeat.
I have tried looking into using the Get Distance To node, but it is not compatible with the player controller or the ai. I have also looked into using a linetrace, but am unsure of how to go about doing that. Would that be the best method, or is there an easier way to find what I need? Also, I need to be able to only read the closest monster to the player, as there are multiple monsters and I do not want multiple heartbeats playing at once.
Thank you for any help; it is much appreciated.