Forum rules - please read before posting.

Simple animations game,clickable buttons which change scenes and start player&other animations

2

Comments

  • a) Use the Sound: Play Action just before you play the movie. You can create a new Sound object within the Scene Manager.
    b) If you are working on iOS, then the Play Movie Action will work differently - since Unity allows movie files to be played back full-screen automatically, without the need to bother with textures etc.  You will need to move the file to a folder called StreamingAssets (see this page).
    I don't know which would be better, in all honesty, but if you want to ensure playback is synced on all devices (some are slower than others) your best bet would be to have the sound embedded in the file itself.
  • Hello Chris,
    Thanks for the help!
    1)So if a game is being built for PC/Mac,movie files which contain sound CAN NOT be used,only soundless movies can be played separately together with a sound file?(two separated processes connected to run together)Correct?

    2)If the game is being built for IOS,movie files which contain sound CAN be used?
    Does this apply to Android too?

    3)I have imported mp4 movie clip with sound into Unity.
    When I click on it,it expands and sound frame can be seen.It can be played in Unity if I click on play in the right lower corner.
     
     I would like to:
    a)Make the movie clip run on start of the game(if I drag the movie clip into hierarchy nothing
    happens,while the sound can be dragged into hierarchy and the audio object gets created).
    How could I achieve this?(please give me step by step answer)

    b)I would like to add a button.If I click on it,movie clip with sound starts.(Its the same idea
    from the start,I know how to connect buttons with soundless animations,now I would like to connect
    them with movie clips with sound)Please give me step by step answer.

    4)You mentioned  StreamingAssets folder for making the game for IOS.That means that when I finish
    the game and want to port it to IOS,then I should move all movie clips into StreamingAssets folder?
    (movie clips do not have to be in that folder during the game development)Correct?
    (the page link you added does not work)

    5)So your recommendation is that if I want to achieve smooth movie clips playback with sound on IOS and Android,I should use movie clips which contain sound?(Not to use soundless movie clips and
     sound files separately and make them  run together at the same time)


                                                                                            Thanks in advance!
                                                                                                              John
     
  • 1) That's right - on PC/Mac, Unity restricts movie playback to textures only.  However, the Engine: Play movie clip Action provides fields to assign a Sound object to sync with.

    2) I believe so - the action uses Unity's Handhled class, which should work for both iOS and Android.

    3a) If you are on PC / Mac, you'll have to create a plane that faces a specially-made camera, and give it a new Material called e.g. MoviePlayback.  Then in your OnStart cutscene, switch to the camera, and use the Engine: Play movie clip Action to play the movie clip on your MoviePlayback material.  To sync with audio, create a new Sound prefab from the Scene Manager, assign it your movie's audio clip, and then assign the new Sound object in your Engine: Play movie clip Action.

    3b) It'd be the same steps as 3a - if you are referencing scene objects from an ActionList asset file, AC will automatically generate the ConstantID scripts for you.

    4) Yes, that's correct.  This is the page I mean to link to.

    5) Things may run just fine either way, but clips with sound would be the safest bet, yes.
  • Hello Chris,
    Thanks a lot for the answers!
    Previous 3a)Can you PLEASE give me step by step instructions how to do that?(click here,go to etc)
    1)Just to double check.Lets say that I complete 3a procedure(how to run video clips on PC/MAC).
    If I would want to port the game to IOS/Android,the ONLY thing I would have to do is to move the video clips to StreamingAssets subfolder of Assets folder?

                                                                                                     Thanks in advance,John

  • Hello Chris,
    2)I have made soundless animation.Now I would like to connect it with a
    sound file so when the animation starts sound can be heard too.So I have animation file and a sound file,now I am looking at those two files and do not know what to do. Please give me a step by step answer!(click on this,move that etc)


                                                                                                    Thanks in advance,
                                                                                                                               John

                                                                
     
  • Hello,
    3)I would also like the previous soundless animation connected with a sound run on start,like an intro animation.How could I do that?

                                                                                                      Many thanks,John
  • 3a) Use the Scene Manager to create a new GameCamera and place it somewhere out of the way.  Create a plane and position it so that the new GameCamera is facing it head-on.  Create a new Material and give it to the plane.  Then create a new Cutscene, and inside it an Engine: Play movie clip Action.  Assign the new Material, and the movie clip file, in the fields within it.  When the Cutscene is run, the movie clip should then play.  Then to get sound working: back in the Scene Manager, create a new Sound object, select it, and assign your audio clip in the Audio Clip field of the new Sound object's Audio Source component.  Then you can assign the Soud object inside the Engine: Play movie clip Action.

    1) You should be able to have the movie clip inside a StreamingAssets folder for both platforms - no need to take it out of there for PC/Mac.

    2) See 1a).

    3) Assign the Cutscene you created in 1a) as your "Cutscene on start" field, in the Scene Manager.
  • Hello Chris,
    Thanks for the help!
    1)I would like to try using Salsa for making talking characters for my animation game.
    For example talking head says different lines after buttons are pressed.Do you recommend Salsa for my game?

    2)You said that the answer to this question was on 1a). However I did not find it.
    I have made soundless animation.Now I would like to connect it with a
    sound
    file so when the animation starts sound can be heard too.
    I would like to click on a button and start the animation together with a sound.
    So I have
    animation file in unity(not a movie clip) and a sound file,now I am looking at those two files and
    do not know what to do. Please give me a step by step answer!(click on
    this,move that etc)

                                                                                                     Thanks in advance,John

  • 1) It's a good tool - that's why AC supports it.  But I don't have a preference of one over another - it's up to you.

    2) I already did - see my post above, starting with "Then to get sound working:".  If you show me what you've done so far, then it will be easier to help.
  • Hello Chris,
    Thanks for the help!!!
    1)Lets say that I am using Salsa in AC.I am talking into microphone,I say "Hello" and the 2d/3d character is lip syncing while I am saying hello.Would it be possible to
    a)Create an animation of character who said hello
    b)Record sound containing hello
    Basically I would like to record a lot of lines which would be connected with buttons.When buttons would be pressed,lip synced salsa character would say the lines.

                                                                                Thanks in advance,John

  • If you're using Salsa, you can use the files it generates to lip-sync your characters automatically - no need to create an animation each time.

    Have you read this tutorial?  That's for 2D, but there's another one for 3D too next to it.  Also be sure to check out section 10.5 of the manual, which details Lip syncing.
  • Hello Chris,
    Thanks for the reply!I am confused.
    I added 3d character into hierarchy and Salsa 3D script into it.In Salsa 3D script under Mouth Shape indexes&Audio-Skinned Mesh Renderer-I added 3d character and for audio clip added "Welcome!" waw file.Therefore when I start the game,the character is lip synced while the waw file plays back and says "Welcome".

    I have a button in the scene.I would like the 3d character to say "Welcome"(by being lip synced and using Salsa 3D script)AFTER I press the button and scene should change.How do I do this?
    (I would like to have many buttons which after pressed would make the character say something
    by using Salsa and it would be nicely lip synced)

                                                                                        Many thanks in advance,John
  • Cutscenes can't carry from one scene change to the next, so if you want the character to say something when the scene changes, you have to place the Action within your "On start" Cutscene, in the Scene Manager.

    You can set/read the value of a Global Variable (e.g. a Popup) to work out which particular line to say, if you have more than one that might play after changing to that scene.
  • Hello Chris,
    Thanks for the reply!
    I have a simpler idea to achieve.
    I added 3d character into hierarchy and Salsa 3D script into it
    There are two buttons in the scene.When I press button No1 3d characters is lip synced,
    says something(Salsa plays back sound waw file No1),the scene does not change.
    When I press button No2 3d characters says something else((Salsa plays back sound waw file No2).
    So,there are 2 buttons,after I press each one the characters says something by using Salsa.
    How could I do this?
    Could you please give me step by step instructions how to do this?(I know how to make buttons
    and how to makethe character automatically says something by using Salsa on START of the game by playing back ONE waw sound file but I have no idea what to do next,how to make actions,how to connect character in Salsa with TWO sound waw files and 2 buttons )

                                                                                                  Thanks in advance,John
  • If you know how to make buttons, and charaters speak, then you're pretty much there.  Set your buttons' Click Type to "Run ActionList" and assign each on a new ActionList (e.g. clickButton1 and clickButton2).  Then you can place a Dialogue: Speech Action within each of these ActionLists.  You can still drag the character in your scene into the Action's "Speaker" field - just be sure to save the scene afterwards.
  • Hello Chris,
    Thanks for the reply!
    I have made 2 buttons,each one has an ActionList assigned.
    1)I tried dragging the 3d character(FBX format)from hierarchy into Dialogue:Play Speech actions "Speaker" field but I couldnt assign to it?Any advices?

    2)I added Salsa 3d script into 3d character.In Salsa 3d script,in Audio clip I put a waw sound file saying "Hello".So in this field 3d character is connected with ONLY ONE wav sound file in Salsa.
    Even if I make two buttons work and 3d character starts talking after both buttons are pressed,the 3d
    character will always playback the SAME wav file that was connected with him in Salsa3d script,it will always keep saying "Hello".So,how could I connect the 3d character with DIFFERENT sound wav files so that after I press different buttons,3d character will playback different waw files or talk differently in Salsa?(at the moment,character automatically says hello on the start of the game)

    3)I have a problem on game startup because a robot falls down through the screen and disappears.
    Is this a bug or I did something wrong?

                                                                                                Thanks in advance,John
                                                          
      
  • 1) You need to have the character in the scene as either an NPC or a Player, that uses the FBX file as a model.  Only NPCs and Players are recognised in the Action's "Speaker" field - not an FBX file directly.

    2) Once you've created a Dialogue: Play speech Action, you need to send it to the Speech Manager by clicking "Gather text" within it.  Speech lines you've created will then be listed at the bottom, and if you click on one, you'll be given more information about what the filename / location for the audio should be.  This tutorial explains more.

    3) You'll need to place down a floor collider, since Tin Pot is affected by gravity, and will fall unless he has something to land on.
  • Hello Chris,
    Many thanks for the reply!!!
    I have followed your instructions and it it works,when I click on any of two buttons,the waw file gets played back and 3d characters is lip synced by using Salsa.
    However there is a problem with Dialogue:Play Speech actions.
    Last key move that I have to make in order to make it work is to drag the player object(which contains FBX model)into the Speaker field of Dialogue Play Speech action in both actions lists that run after
    both buttons are pressed.I start the game,after it starts,Speaker field of Dialogue Play Speech action in both actions lists goes back to None(Char).So while in play mode,I AGAIN drag the player object into the Speaker field and now it works,when I press both buttons,character is lip synced while sound gets played.But when I stop the game,Speaker field goes AGAIN back to None(Char).
    Therefore I can not make the AC REMEMBER to keep the player object in the Speaker field of both actions.Any advices please?

                                                                                               Thanks in advance,John
  • There's a checkbox labelled "Is Player?" just above the speaker field.  Check that instead of dragging the player prefab - it's there because the field won't remember a prefab.
  • Hello Chris,
    Thank you for the reply!!!
    Above the Speaker fielad inthe Dialogue:Play Speech action I can not find "Is Player?",I only have  "Player line?" checkbox.If I check it,Line text,Head and Mouth animation options unlock but I can not use them for what I want.If "Is Player?" checkbox is unchecked,Tin Pot is inserted in the Speaker field.Any advices please?

                  
                                                                                            Thanks in advance,John
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.