Footsteps on AI walking always sounds like they are on my camera

bbjones

Member
I think this is a fairly simple setup to reproduce...

Create a new Opsive character as AI/Agent.
Place in scene and on scene start have them walk away from the stationary camera (I'm using a BD seek waypoint but not sure it matters how you have them walk away).

The footsteps sound like they are coming from the stationary camera position, despite the AI character walking away from the camera.
In other words, the sound doesn't fade into the distance.

This happens the same no matter how many AI agents I have in the scene. They all sounds like they are right on top of my camera, even if I move my camera.

Cheers
 
Do you feet GameObjects have an AudioSource? If your feet do not have an AudioSource then the Surface System will use AudioManager.PlayAtPosition, whereas if your feet do have AudioSources then it'll use that AudioSource.
 
Yes, both feet do, and both of those objects are listed correctly under the generated Character foot effects script.

I have a stationary main camera, place a character prefab on screen and build them as AI, add a behavior tree and set a target waypoint.

When play starts, the Opsive Game object shows new audioSource objects being created (1-4 for different footstep variation clips), these audio sources do not show the falloff in the sound settings graph.
The audio sources on the feet do show the graph distance growing as expected, but those audio sources do not have clips.

1575650392157.png

I have tried registering the game object when spawned, doesn't seem to make a difference.

Opsive.UltimateCharacterController.Audio.AudioManager.Register(this.spawnedCharacter);

I have now also found a way to make it work but can't see why anything changes...

If I use a character model from an asset pack the audio works as expected.
If I use a character prefab from the asset pack, the audio is stuck on my camera.
I don't see any difference in how Opsive sets up the character based on a model or prefab so don't get why it matters.

Is there documentation on how to setup your own custom models through to being complete prefabs to work correctly? I've been fighting stuff like this for weeks.
 
They do, and they came from building the Opsive character, I didn't add them. They are automatically added to the feet correctly and linked up to the scripts. They look the same as other characters that work, just no idea why it doesn't work when using a prefab, which is just the base fbx model with some materials on it as a new game object, no other scripts or Opsive stuff on it.
 
From the character controller's perspective a model within the scene versus a prefab shouldn't matter. Can you place a breakpoint within CharacterFootEffects and see why the Surface Manager isn't using the foot originator?
 
Top