Forum rules - please read before posting.

Footsteps and Autodetect

I am struggling to get the new footsteps system to work via the Auto-detect Surface feature, the issue being that it never changes footsteps sound unless I manually change it via an action. I have the component set to Via Animation Events and Auto-detect Surface is ticked.

The objects being walked on have colliders and appropriately-named physics materials ("_Metal" etc) applied, and they are on layers displayed in the layer mask.

I can easily continue by manually changing the sounds via trigger etc, but I was hoping to use the Auto-detect feature to save time.

This is using AC 1.84.3 (planning to update) and Unity 2022.3

Comments

  • Can you share screenshots? I'll try to spot the issue.

  • How do we post screenshots now that imgur is blocked in the UK? Is there a way to just do it directly?

  • Any image-sharing site will do such as Google Drive, Dropbox, or imgbb.

  • Okay, I have taken screens of what would be the most relevant stuff and displayed them here

  • Ah - the "_" character is intended as a separator added by AC, i.e. the Surface "Metal" can be detected by a Physics Material named e.g. "Slippery_Metal", "Bouncy_Metal", "Normal_Metal".

    Remove the "_" characters from your Surface names (not the Physics Materials) and they should be detected.

  • No luck I'm afraid, I removed the underscores from the Surfaces (but left them on the physics materials) but the same sounds keep playing.

    Also the instructions say the physics material should end (though I think it means start) with a "_" so in your examples here, should it be "_Slippery_Metal" "_Bouncy_Metal" etc? I think you're on the right path though with the Surfaces and Physics Materials not linking to each other for whatever reason.

    btw It would also be good in a future update if we could get some kind of visual representation of how long "Ray Length" is (on Surfaces component).

  • The instructions are to end the name with an underscore, followed by the Surface's name.

    Can't see an issue with it otherwise. If you're up for some debugging, the processing of the detected Surface's name occurs in the FootstepSounds component's ProcessName function. Inserting this at the top will display the name of any detected Physics Material:

    Debug.Log("Material found: " + name);
    

    Does the Console show this line as the character moves around?

  • Ah, yes it is finding the material and printing it in the console. Also I tried using different Surfaces & Materials than I was using before and it is correctly changing the sounds as intended.

    However, I have one material called "_Metal_Sheet" and even though the material is being detected (it's in the console) the sounds are not changing - I suspect it is the way I have written the name. The Surface is named "MetalSheet" .

  • The material for a surface named MetalSheet would need to end with "_MetalSheet".

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.