Hi everyone,
My name is Denys, and I’m new to the Opsive forum!
Quick intro: I’m a programmer with ~12 years of experience, mainly in iOS development. I’m exploring Unity 6 in my free time to build a top-down horror game focused on stealth and tense combat. To help speed things up, I’m using Ultimate Character Controller and Behavior Designer Pro.
I’m currently working on two mechanics and would appreciate some guidance:
1. Enemy Sound Detection
I want enemies to react to sounds made by the player (running, breaking glass, firing, squeaky doors, melee hits, etc.).
For MVP, I’m using the Atlas player prefab and EnemyAtlas prefab from the demo. I set up a Behavior Tree using CanDetectObject with the Player set in ObjectDetectionMode.
Right now, enemies only react to pistol reloads – not footsteps, gunfire, or melee swings.
I suspect I need to switch to TagDetectionMode or LayerDetectionMode and assign those to objects with audio sources. It seems like AudioSource.PlayClipAtPoint alone doesn’t trigger detection. Am I on the right track?
2. Player Hiding in Grass
I want enemies to ignore the player when crouching in tall grass. My idea: assign a tag like IsInvisible to the player when they enter a grass volume and crouch. Then use CanDetectObject with TagDetectionMode + an Invertor to block detection.
Is this a solid approach, or would you recommend a cleaner method?
Thanks in advance for any tips or best practices you can share!
Cheers,
Denys
My name is Denys, and I’m new to the Opsive forum!
Quick intro: I’m a programmer with ~12 years of experience, mainly in iOS development. I’m exploring Unity 6 in my free time to build a top-down horror game focused on stealth and tense combat. To help speed things up, I’m using Ultimate Character Controller and Behavior Designer Pro.
I’m currently working on two mechanics and would appreciate some guidance:
1. Enemy Sound Detection
I want enemies to react to sounds made by the player (running, breaking glass, firing, squeaky doors, melee hits, etc.).
For MVP, I’m using the Atlas player prefab and EnemyAtlas prefab from the demo. I set up a Behavior Tree using CanDetectObject with the Player set in ObjectDetectionMode.
Right now, enemies only react to pistol reloads – not footsteps, gunfire, or melee swings.
I suspect I need to switch to TagDetectionMode or LayerDetectionMode and assign those to objects with audio sources. It seems like AudioSource.PlayClipAtPoint alone doesn’t trigger detection. Am I on the right track?
2. Player Hiding in Grass
I want enemies to ignore the player when crouching in tall grass. My idea: assign a tag like IsInvisible to the player when they enter a grass volume and crouch. Then use CanDetectObject with TagDetectionMode + an Invertor to block detection.
Is this a solid approach, or would you recommend a cleaner method?
Thanks in advance for any tips or best practices you can share!
Cheers,
Denys