Forum rules - please read before posting.

Jump sound issues

Hello Chris !!

i try to implément a sound when my character is jumping but my sound doesnt trigger.

i created an Active Input with the input button "space" to detect when the jump is toggle.( Green Square on the Screenshot )

i create an actionList "PlaySoundOnJump" with 2 parameters, first one Input Toggle Active for the Active input created ( New State is check ) and then it continue to > Sound / play one shot and my sound.( Blue Square on the screenshot

I attached it, in the Action List Script on my character with a "Asset File".
(yellow square on the screen shot.

https://imgur.com/a/sTBOtOA

do you have an idea ? thanx a lot.

Cyril

Comments

  • edited March 2021

    If you're using an Active Input to run an ActionList, you don't need to reference that list outside of the Active Inputs Window - you can remove the ActionList component attached to your Player.

    Also, the "Input button" field should refer to the Input created in Unity's Input Manager - not the name of the key you actually press.

    In Unity's Input Manager, make sure you have a input named e.g. "Jump" in the list, with its Positive Button set to "space" (no quotes). Then, in the Active Inputs window, set the "Input button" to "Jump".

  • that works perfectly, thanks for your veryyyy quick reply. I understand the issues.

  • hm i spoke to fast,
    in this way, whenever i press space bar, inside menu or anywere, thats trigger the jump sound
    So i try another thing,
    i remove the Action list when triggered in active inputs ( screen shoot blue square )
    to avoid double reference like you mentioned,

    and add Action list in the player prefab, with the action list asset.( screen shoot green square )
    but the sound didnt trigger.
    i also add a player check action.

    https://imgur.com/a/9y9rm1D

    i can manage that without an active input ?
    my goal is just to enable jump sound on the player only in game and not in the menu ( thats logic ahah :p )

    again thanx for your time !

  • You still need a way of triggering the ActionList. For now, keep things as they were - with an Active Input triggering it.

    You just need to precede the Actions you have with a Menu: Check state Action to check if your Menu is currently open, and prevent the sound from playing if so.

    In the next update, however, I will expose an event hook that fires when the Player jumps - making it much easier to reliably run an ActionList when a Player does so.

  • edited March 2021

    Ok yes i see !
    in my menu now its ok ! i had an issue in a scene that i don't want it to play, i resolve it with that on the screenshot
    ! ( it may be usefull for other users !! )

    https://imgur.com/a/2tPDXNV

    thanx for your time Chris !

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.