- Home /
Totally new noob to mecanim and unity itself - Trigger animation?
Hi, currently I'm trying to achieve this:
When my character goes through the door, a woman turns to him and starts talking and also moving towards him, but i just can't find any tutorials on how to do that. I already have made the animations all i need is to apply them...
Answer by LaneFox · Jun 30, 2015 at 12:40 PM
You can use SetTrigger in the Animator component to fire triggers in your AnimationController. You'll have to get a reference to the component first with GetComponent() then send SetTrigger commands to it.
For the movement/etc you'll setup trigger zones and use OnTriggerEnter or use Coroutines in conjunction with WaitForSeconds to choreograph the timing of the cutscene but that all depends a lot on how your animations are setup.
To make the character move you'll have to turn the character, probably using LookAt and then using the animation to move the character with Root Motion. If you're not using root motion (using in-place animations) you'll have to translate the character's position manually using Translate or MovePosition (Rigidbody only).
Okay, well that seem hard enough, is there a detailed(almost step by step lol) version of what u just told me somewhere out there? Because I'm totally new to unity
I am sorry, I can't stand "Explain me, I am a noob to Unity".
There are plenty of tutorials of Unity all over the web, the ones on the Unity website itself are very good. Every persons new to Unity should watch them before co$$anonymous$$g here asking questions whose answer is in the tutorials...
These are all references to the API. If you do not have a basic understanding of C# then you won't be able to do what you want and need to review the tutorials. No one can make a step by step for every single thing you need to do in Unity and this issue in particular is largely related to scripting. You have to learn the fundamentals and afterwards you'll understand how to do just about anything you want. If you have specific issues coding and need help, feel free to ask about those problems but like Hellium says - put forth the effort first.
Your answer
Follow this Question
Related Questions
Why isn't my animation being played? 0 Answers
Mecanim Triggers Not Deactivating 0 Answers
Trigger Animation Instantly? 2 Answers