I'm looking for some technical advise. I'm making my first adventure game(2D).
I have a player walking about the first scene, he is animated in 4 directions. The characters first task
is to put a T-shirt on. I have the T-shirt animated so it can be on the character and follow the characters
walk animation.
So can i have the T-shirt animation invisible, then enable it when he picks up the T-shirt?
Or is there a better way?
Thanks
Comments
The character has 4 items of clothes, which can be found in any order. So i was trying to avoid a
silly amount of combinations(16), hence i thought i could have the character wear all the clothing layers, but have them invisible till pick-up.
It was a clever solution to save me doing loads of frames.
Once you have your idle/walk/talk etc animations wired up again using this method, you can then have the clothing as an additional mecanim layer, and have another parameter control which animation is played. You can then control this parameter using the Character: Animate Action.
another sprite renderer for your second layer. This causes another problem, the direction and speed parameter isn't passed onto this second sprite, so you can't animate your second sprite to match the first. I'm sure there is a work around, but this was to save me time, it hasn't.
I just need to get the 0,1,2,3(direction) + Speed data, to my new sprite and i'm fixed.
Any ideas?
/Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/DopeSheetEditor.cs:721)
UnityEditorInternal.DopeSheetEditor:CreateNewPptrDopeline(Type) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/DopeSheetEditor.cs:683)
UnityEditorInternal.DopeSheetEditor:HandleDragAndDropToEmptyArea() (at /Users/builduser
/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/DopeSheetEditor.cs:624)
UnityEditorInternal.DopeSheetEditor:OnGUI(Rect, Vector2) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/DopeSheetEditor.cs:105)
UnityEditor.DockArea:OnGUI()
It looks like you must have a Sprite Renderer with an Animator, so you basically can't do layers without scripting.
Monophonic.
Place a single Animator component on your sprite child, which should also have a "base" sprite such as the torso (or could just be an empty SpriteRenderer component). Then add any other sprite "layers" you need as child objects of that. Your Animator will then be able to control the child sprites as well as the one that's placed on the sprite child - the only thing an Animator can't do is control objects higher up in its hierarchy. Any parameters in this Animator will be accessible by these child objects - it's the Animations that go in the Animator that get directly controlled.
As AC makes use of Unity's animation system, be sure to check out some of the official animation tutorials if you're just starting out.
tell Unity to render the T-Shirt in it's own Sprite Renderer, so it puts it in the body Sprite Renderer.
The only solution is to give the T-Shirt layer it's own Animator. But then the Direction and Speed value
doesn't get passed on.
I've been watching tutorials, and reading forums, i've spent a lot of time on this, i'm not an expert by
any stretch, but i'm pretty sure what i what to do isn't possible without scripting.
Anyway, i can render out all the animation (16 combinations), and do it that way. I would of been super handy to do it the way i wanted, but i'm not stuck completely.
Thanks for responding. Your side of things is great, and i'm loving using Adventure Creator, i think
this is a Unity thing.
What you probably want to do is have something like a final layer that animates the "enabled" state of the T-Shirt sprite renderer / GameObject itself, so that no matter what animation is playing you can separately control whether it's showing or not. You can then wire up transitions/parameters so that you can control the visiblity of the T-Shirt using Character: Animate.
You may have better luck asking about this on the Unity forums.
I found a similar problem on a Unity Forum.