Forum rules - please read before posting.

Must use sprites unity complex for playing custom player animations?

So as far as i can tell you have to use sprites unity complex instead of sprites unity if you want to play a specific player animation that isnt a walk/idle animation?

Right now i have an inventory item (cigarettes) that when the player uses its supposed play a specific animation (smoking), but it doesnt play and i assume its because im using sprite unity still cause i couldnt figure out how to redo my player character with sprites unity complex. 

It seems as if my only choice is to figure out sprites unity complex in order to get this animation to play? Which DOES work if i switch to sprites unity complex.. but then my character movement animations are nonexistent since ive been struggling to figure out how to set it up with sprites unity complex.

Comments

  • I don't have a solution, but I'd like to add: I would also appreciate a sample CharacterController/Animator that mimics the behaviour of "Sprites Unity" but with the options of adding your own custom stuff more easily. If that's possible.
  • edited October 2016
    The 2D demo game's player character, Brain2D, is built with Sprites Unity and allows for custom animations.  Sprites Unity Complex isn't so much "complex" as it is a more "normal" way of working with Unity's Animator system - i.e. playing animations by changing parameter values.  Sprites Unity uses the more straightforward approach of playing animation clips directly by name.  The 2D Demo scene, Park, can be picked apart to illustrate how this works.

    When using Sprites Unity, you have the option to have the directional suffix (e.g. "_D" for down) added on automatically when the Character: Animate Action is used to play a custom animation.  This allows you to have different smoking animations depending on the direction the character is facing.

    The Console should display an error message if it can't find the animation you're trying to play - check that to see if it sheds any light.  Otherwise, please post screenshots of your Animator (showing the animation you're trying to play), your Player Inspector, and the Character: Animate Action you're calling.

    @Lukas: That's a fair suggestion!  I'll look into that.
  • edited October 2016
    Good to know about the directional suffix i had assumed that worked but hadnt tried it yet!

    When i try to use character: animate i did have an error/issues so i had been trying to use object instead so thats the real issue then i guess!

    Here is what happens when i use character animate instead of object.

    Character Animate:
    If i click is player it says This action requires a character before more options will show.
    If i assign the character as the player by browsing for him (instead of just hitting is player) and assign the animation then i get Could not create animation engine and if i go back in to my actionlist after running the game it has reset the settings i had assigned.

    I think i am some how missing the part of the code that does this for some weird ass reason. like it doesnt exist?

    Heres my error:
    Could not create animation engine!

    -----------------------------
    UnityEngine.Debug:LogWarning(Object, Object)
    AC.ACDebug:LogWarning(Object, Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:26)
    AC.ActionCharAnim:Run() (at Assets/AdventureCreator/Scripts/Actions/ActionCharAnim.cs:105)
    AC.<RunAction>c__Iterator2:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:331)
    UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
    AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:295)
    AC.RuntimeActionList:BeginActionList(Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/RuntimeActionList.cs:106)
    AC.ActionList:Interact(Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:172)
    AC.RuntimeActionList:DownloadActions(ActionListAsset, Conversation, Int32, Boolean, Boolean, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/RuntimeActionList.cs:95)
    AC.AdvGame:RunActionListAsset(ActionListAsset, Conversation, Int32, Boolean, Boolean) (at Assets/AdventureCreator/Scripts/Static/AdvGame.cs:286)
    AC.AdvGame:RunActionListAsset(ActionListAsset, Int32, Int32) (atAssets/AdventureCreator/Scripts/Static/AdvGame.cs:178)
    AC.RuntimeInventory:Use(InvItem) (at Assets/AdventureCreator/Scripts/Inventory/RuntimeInventory.cs:807)
    AC.MenuInventoryBox:HandleDefaultClick(MouseState, Int32, AC_InteractionMethod) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInventoryBox.cs:621)
    AC.RuntimeInventory:ProcessInventoryBoxClick(Menu, MenuInventoryBox, Int32, MouseState) (at Assets/AdventureCreator/Scripts/Inventory/RuntimeInventory.cs:1560)
    AC.MenuInventoryBox:ProcessClick(Menu, Int32, MouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInventoryBox.cs:1067)
    AC.PlayerMenus:CheckClick(Menu, MenuElement, Int32, MouseState) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1940)
    AC.PlayerMenus:CheckClicks(Menu) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1621)
    AC.PlayerMenus:CheckForInput() (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1702)
    AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:300)

    Is player wont allow me to choose an animation:
    image

    Assigning the character manually i can choose an animation but then the following happens..
    image

    image
  • UPDATE:
    hmm.. if i go in and choose my player character by browsing for him and then assigning the animation (like in the second image) and check is player then it works.

    Shouldnt it work if i just hit is player without having to browse for it and choose the player character & then click is player? Maybe not.. seems like most other actionlist things when you click is player then it shows what the options are.. so this could be my fault for not realizing i had to do it this way..
  • edited October 2016
    When you check Is Player?, it'll search for whatever prefab you've assigned in the Settings Manager.  Because the contents of the Action depend on the chosen character's animation engine, it needs to know the details of the character you want to affect - so if you haven't assigned a player prefab, it won't know what animation engine you're using.

    Check that your player prefab is registered within the Settings Manager, and assign it if not.
  • edited October 2016
    Huh strange could have sworn i had added the player to the settings.. im surprised other (is player) actions have been working, but maybe its more just that animations need to know this more so?

    thanks that did the trick! 
    sorry for wasting your time!

    Really loving both adventure creator and unity (which i had some experience but not much) so i am really learning both of them at the same time remaking a project. I gotta say i am really loving adventure creator!
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.