Forum rules - please read before posting.

Simple Button to switch between scenes

Hi, I thought it will be very easy, but couldn't find the most suitable AC element to use the simple button.

I want the character to switch between scenes of Hall and KItchen. When User is ending the Sofa Hotspot the "Kitchen" Button will appear which is in the bottom middle in the image I provide and the User will be switched to Kitchen Scene from Hall Scene just clicking on that "Kitchen" button.

What is the most easy and non code way to do it? Thanks.

Comments

  • edited June 2024

    I've managed to do this with Menu> New Interaction> Create Button.

    Now I want to apply a sound on the click of the button, but the sound isn't playing. I've tried to add the sound in hierarchy and then attach to the Click sound slot in Interaction Button I've created, but the slot is not tacking that file, also tried to add Sound Logic from Adventure Creator Scene Manager, but the Click sound slot is not accepting the files from hierarchy, only the prefab file, but even with prefab file, it is not playing the sound.

    Here are the settings

  • Are you using the Scene: Switch Action to handle the scene-switching?

    You can precede this with the Sound: Play one-shot Action to play an AudioClip without need for a dedicated Sound object.

  • Yes, I'm using Scene: Switch Action

  • edited June 2024

    I've added Sound: Play one-shot Action to play the AudioClip, but it is not playing. I've added it in the ActionList created for the Interaction button. I've also tried the change nodes places, firstly scene switch then sound, but same effect, sound is not playin go on button click.

  • Try checking Wait until finish? - it may be that the sound is destroyed before being heard due to the scene-change.

    If that works, have the AudioSource be set to a persistent object - which you can do by attaching the Survive Scene Changes component to a new empty GameObject that has an AudioSource.

  • I've already tried the wait until finish? both checked and unchecked, I forgot to write it earlier. It does not work

  • Please help, I don't know what to do

  • Test the sound without the scene-switching - first, try running the Sound: Play one-shot Action from a separate Cutscene within the scene. If it doesn't play, assign an AudioSource that has its Spatial Blend set to 2D.

    It may be that the sound is playing, but not audible - either because the Camera is too far away, or that your SFX volume is low.

    What is your AC version? It doesn't look like the latest - in a backup project, try importing the current release to see if the Sound: Play one-shot Action.

  • edited July 2024

    The AC Version is 1.78 but I don't want to update, since last time I've done that I've lost my progress, maybe I misunderstood something, but I'm definately not going to update it going.

    As I understood my sound is being played but with no sound, cus for the other 2 sec sound I've waited exactly 2 secs before my camera fades out.

    I have background music playing in my Game, maybe it can affect the sound playing somehow?

    I've do what you said, didn't help

    I also don't know how to assign an AudioSource to that Sound: Play one-shot Action, in Spacial Bledn option also there is no 2D, only left and right options in sound's inspector

  • Somehow I've managed to play the sound for the button, but with Sond:Play Action, giving an Audio source object to it and selecting a sound fro prefab in New clip (optiobal) section, is it ok to do it this way? Will after this in Game this sound be accepted as SFX? Like I can change the volume from SFX tab in game's Menu button?

  • A Sound object will need to be present in the scene for it to properly adjust volume.

    If you're calling this from an asset, and referencing a scene object, you'll need to make sure its both present in all scenes, and has the same associated Constant ID value - which you can do by making a new Sound prefab, attaching Constant ID, checking Retain in prefab?, and placing in each scene. Then, have your ActionList refer to one of these scene objects (recording the shared ID number).

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.