Forum rules - please read before posting.

Tinpot can't be animated in 3D game tutorial

Hi there, really didn't want to bother up people here, but I've been trying to fix this problem for about an hour, I've even tried to not call the parameter PressButton with Play Custom Method in Panel Buttons: Use ActionList, but called it with change parameter value, giving the animation an integer value of 1in animator and tried to call it in actionlist, but I get an error message with the text "Parameter 'PressButton' does not exist. UnityEngine.Animator:SetInteger (string,int)" with trying to do with the integer and the "Animator.GotoState: State could not be found UnityEngine.Animator:CrossFade (string,single,int)" error with calling it directly, maybe I'm doing something wrong, I don't know, will be really great if someone can help me to figure out how can I animate the tinpot to Press that Button with PressButton animation.

Adventure Creator version 1.73.5
Unity Version 2020.3.14f1.713 Personal

Thanks beforehand.

Comments

  • If you use the "Change Parameter Value" option, you must have a parameter that matches both the supplied name and type in your Animator - configured to trigger a transition to your intended animation.

    The tutorial instead relies on the "Play Custom" option, which calls the animation state directly by name. Bear in mind, though, that this state name is independent from the animation clip itself.

    In the tutorial, the animation clip's name, rRobot|Robot_PressButton, has its state name shortened to PressButton once placed in the Animator. It's this state name that must be entered into the Action.

    If you can share screenshots of your player's Animator, and the Action you're using to call the Action, I can give more specific advice.

  • I've done exactly what you wrote and I get 0 result, here are the screens of my settings




    Thanks for your reply.

  • edited October 2021

    See the yellow "Parameter 'PressButton' does not exist" warning in the Console in your first two screenshots.

    The Animator and Actions look correct, but this warning should not be caused by them. Does this warning continue to show when running the "Panel Buttons: Use" ActionList, or was it a leftover from a different combination of settings?

    If it remains, select it to reveal the full stacktrace and copy/paste it here.

    Keep the Console window open when testing - what else is listed?

  • Hi, Chris, thanks for your reply, sorry for delay, I was working on my usual work.

    It is all what I get in log trying to play the animation ingame pressing on the Buttons in Panel hotspot

    This is what I get when running the "Panel Buttons:Use" Actionlist

    And the log continue giving similar errors, here you can see it gave me 75 similar errors

    Here is what exactly log wrote.

    PlayerPrefs Key 'AC_Savegame_0' loaded

    -> AC debug logger
    UnityEngine.Debug:Log (object,UnityEngine.Object)
    AC.ACDebug:Log (object,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:20)
    AC.OptionsFileHandler_PlayerPrefs:LoadOptions (int,bool) (at Assets/AdventureCreator/Scripts/Options/OptionsFileHandler_PlayerPrefs.cs:39)
    AC.Options:LoadPrefsFromID (int,bool,bool) (at Assets/AdventureCreator/Scripts/Options/Options.cs:191)
    AC.Options:LoadPrefs () (at Assets/AdventureCreator/Scripts/Options/Options.cs:130)
    AC.Options:OnInitPersistentEngine () (at Assets/AdventureCreator/Scripts/Options/Options.cs:51)
    AC.StateHandler:Initialise (bool) (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:103)
    AC.KickStarter:SetPersistentEngine () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:183)
    AC.KickStarter:Initialise () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:1139)
    AC.MultiSceneChecker:Awake () (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:43)

    Spawned instance of Player 'Tin Pot'.

    -> AC debug logger
    UnityEngine.Debug:Log (object,UnityEngine.Object)
    AC.ACDebug:Log (object,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:20)
    AC.Player:SpawnFromPrefab (int) (at Assets/AdventureCreator/Scripts/Character/Player.cs:1030)
    AC.KickStarter:PreparePlayer () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:1208)
    AC.KickStarter:Initialise () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:1147)
    AC.MultiSceneChecker:Awake () (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:43)

    Animator.GotoState: State could not be found
    UnityEngine.Animator:CrossFade (string,single,int)
    AC.AnimEngine_Mecanim:ActionCharAnimProcess (AC.ActionCharAnim,bool) (at Assets/AdventureCreator/Scripts/Animation/AnimEngine_Mecanim.cs:479)
    AC.AnimEngine_Mecanim:ActionCharAnimRun (AC.ActionCharAnim) (at Assets/AdventureCreator/Scripts/Animation/AnimEngine_Mecanim.cs:380)
    AC.ActionCharAnim:Run () (at Assets/AdventureCreator/Scripts/Actions/ActionCharAnim.cs:111)
    AC.ActionList/d__41:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:428)
    UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
    AC.ActionList:ProcessAction (int) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
    AC.ActionList:BeginActionList (int,bool) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:346)
    AC.ActionList:Interact (int,bool) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:247)
    AC.ActionList:Interact () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:210)
    AC.ActionListEditorWindow:TopToolbarGUI (bool) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:1113)
    AC.ActionListEditorWindow:OnGUI () (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:238)
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

    Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak

    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 7)

  • edited November 2021

    Maybe it has some issue with this element in Hotspot:Panel's ActionList ?

    Because in your tutorial you have a little more option for movement

    Hovewer I've tried to set the movement in my settings to all possible options as "Movement> Disable | Enabled | No change" but the same errors occured and the tinpot animation still doesn't runing.

  • This is what I get when running the "Panel Buttons:Use" Actionlist

    If the Animator in your screenshot is the one being affected by your "Character: Animate" Action, then the warning shouldn't be showing and the animation should it play.

    Is it possible that the Animator Controller asset used by your Player at runtime is not the "PlayerController" you've added the animations to?

    "Tin Pot" is the Demo game's Player character - though he shares the same model and idle/walk animations as the tutorial, the tutorial has you create a separate Player. Make sure that your own Player prefab is being used, and that he's using the correct Animator Controller asset in his Animator component.

    in your tutorial you have a little more option for movement

    Which movement options show in this Action depends on your Settings Manager's "Movement method" option. If this is set to Direct - as in the tutorial - you should see all four movement fields. What movement are you using?

  • Surely you are a genious, I don't know how, but my player prefab in AC Game Editor>Settings>Character Settings was not the one that has the PlayerController on it's controller in inspector, it was the other prefab from Project folders in Assets>Adventure Creator>Demo>Resources. I don't know how that prefab got to the default player prefab, but it was the trick. Thanks for solving my problem.

    My movement method is Point and Click, I think that is why I have only one movement direction method.

  • But I see one more problem, it's idle animation don't work, but run and walk animation are working properly

  • In what way does idle not work? What plays instead?

    The best way to debug an Animator issue like this is to keep the Animator window open while the game is running. If you select your Player object in the Hierarchy and then view the Animator window, it'll show you the "live" state of the controller - check that the Locomotion state is being run, and check the value of the Speed parameter.

  • thanks for the answer, but it worked on it's own somehow

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.