First-Person-Controller-VeryHotShark icon indicating copy to clipboard operation
First-Person-Controller-VeryHotShark copied to clipboard

Footstep system

Open attentionaldefinition opened this issue 5 years ago • 4 comments

Hey, I'm not sure if this is the correct place to ask, but is there any chance for a footstep system? Shooting a raycast and seeing what layer the object is on is easy enough, but I'm wondering how one would handle the logic for actually managing the sounds. Ideally, it'd have to depend on the player's walk/run speed, I suppose.

attentionaldefinition avatar Jul 18 '19 19:07 attentionaldefinition

I'm sure there's plenty of ways to implement this feature. I know the beta Unity FirstPersonController uses a Stride Length concept. It keeps a bool m_IsLeftFoot and toggles that based on the distance traveled (which is a square magnitude float that is updated every Tick while grounded). It has a serializable class called MovementEventLibrary that holds arrays for movement events which can be a particle or a sound which can be affected (intensity of particle or volume of sound) by the movement event data. So... maybe more complex than I actually expected, but it makes sense to support realistic volume levels, varied audio based on ground type, left/right foot, etc. Source (warning: not suited for easy integration to this FirstPerson system): https://github.com/Unity-Technologies/Standard-Assets-Characters/blob/cd7f377a9409ceddfb4e67ff9ae9f03b9cfd7e61/Assets/_Standard%20Assets/Characters/Scripts/FirstPerson/FirstPersonBrain.cs

beardordie avatar Jul 24 '19 05:07 beardordie

I actually considered making footstep system and i will definetely add it when i will have more time and i will try to make it as flexible as i can but i thought about using curves for footsteps since headbob is also based on curves

VeryHotShark avatar Aug 04 '19 13:08 VeryHotShark

I will take a look at this unity implemetation beardordie :)

VeryHotShark avatar Aug 04 '19 13:08 VeryHotShark

Just coming back to my project, and remembered this issue. Needed a quick solution, and this asset worked beautifully. Coded in some stuff I needed, like landing sounds, random pitch, etc, and it's been great so far.

attentionaldefinition avatar Oct 10 '19 19:10 attentionaldefinition