Footstep Sound Issues

C

CursedToast

Guest
Hi guys,
A couple of issues with footstep sound effects.

First, does the Camera Bob footstep mode require an animator (I hope not - it sounds ideal for first person) ? When trying to use it, I get a null reference error followed by this error:
Error: There is no look source attached to the character. Ensure the character has a look source attached. For player characters the look source is the Camera Controller, and AI agents use the Local Look Source.

Second, I tried switching to Fixed Interval as suggested to me prior (I do not use a model/animator for my character). However, footsteps continue to play even when you're holding down a movement button and your character isn't moving.

I created a video showing this behavior - the player transform nor the camera transform move so I'm not sure if this is a bug, requires more setup on my end, or is the tradeoff of using this mode.


Edit: I've since changed the height of my capsule collider from the default value of 2, to 1.5. Now I don't register footsteps at all. Can reproduce this with a fresh project and character. Not sure what I'm missing here...
 
Last edited by a moderator:
As long as the look source (camera) bobs up and down there's no specific need for an Animator Controller for the camera bob mode to work.

Unfortunately the Fixed Interval mode doesn't take any actual movement into account, only the player's input. You could modify the fixed interval mode to only account for when the character's distance from its position last from is above a minimum value.
 
As long as the look source (camera) bobs up and down there's no specific need for an Animator Controller for the camera bob mode to work.

Unfortunately the Fixed Interval mode doesn't take any actual movement into account, only the player's input. You could modify the fixed interval mode to only account for when the character's distance from its position last from is above a minimum value.

Okay, then there's a bug or something, because I'm getting a null reference error and the error I quoted in my OP when I try to use Camera Bob. That's also quite a silly default behavior for Fixed Interval - the documentation implies that it should fire as long as the character is moving, not as long as there's input.

If using the FixedInterval mode, specifies how often the footsteps occur (in seconds) when the character is moving.

In this post I recorded the reproduction steps for the Camera Bob setting error I'm getting, along with other errors.
I would have done separate videos for the two threads, but the errors I'm getting match with both threads, so I assume one fix will solve the other.
 
Last edited by a moderator:
When you adjust the collider height you should also adjust the center location so the bottom of the collider is at the pivot location.

In terms of the look source error, the CharacterFootEffects script wasn't made initially to not have a full body animator and that's why the Character Manager doesn't allow you to add it. It's an easy change though in order to support. On line 267 of CharacterFootEffects change:

Code:
                m_LastVerticalOffset[0] = m_VerticalOffset[0] = m_Transform.InverseTransformPoint(m_LookSource.LookPosition()).y;
to:
Code:
                if (m_LookSource != null) {
                    m_LastVerticalOffset[0] = m_VerticalOffset[0] = m_Transform.InverseTransformPoint(m_LookSource.LookPosition()).y;
                }
 
I vote for adding a check for the character’s movement at a fixed interval of steps, otherwise he plays a sound if he just walks into a wall, which is not logical.
 
Top