![]() ![]() Note: values above approximately 700 or below 256 may produce strange outputs. One extra thing, though: if this character is intended to be the default Player character, make them a prefab by dropping them into the Project window, and then assign that prefab into the Settings Manager's Player prefab field:ĭoing so will cause the Player to be spawned whenever an AC scene is run - meaning you can safely remove the Player from the scene file itself.“2” is the default, which returns a 2x2 grid with 4 images. The character is now ready to be placed in our Adventure Creator game! In our Controller, the Walk animation plays when the float is greater than 0.1, but when it's greater than 1 the Run will play instead, so set the Walk speed scale to 1, and the Run speed scale to 2. This float becomes -1 when the character turns left, and +1 when the character turns right.ĭown in the Movement settings panel, we can define what values the MoveSpeed float will take when the Character moves. If we wanted, we could also supply a Turn float Parameter to integrate into the Controller. Set the Move speed float to MoveSpeed, and the Talk bool to IsTalking. Here, we can tell AC which parameters within our Animator Controller that it can control. You can also have the character make use of Unity's NavMesh Agent by also adding the NavMesh Agent Integration component.Īdjust the character's Capsule Collider or Character Controller so that it spans the full height of the character:Īt the top of the newly-added Player or NPC component, there'll be a section named Mecanim parameters. Then, assign the model's GameObject from the scene into the field beneath: From the top toolbar, choose Adventure Creator → Editors → Character wizard to bring up the Character wizard.Ĭhoose Next and choose whether this is to be a Player or an NPC. We're now ready to convert the object into a character. Your completed Controller should look like this: For smoother motion, you can also make use of a Blend Tree for the Idle, Walk and Run transitions. For the Idle → Talk Transition, set the Condition to IsTalking true.Īnd for the Talk → Idle Transition, set the Condition to IsTalking false.įor all of these transitions, you probably want to also uncheck Has Exit Time. For the Walk → Run Transition, set the Condition to MoveSpeed Greater 1.Īnd for the Run → Walk Transition, set the Condition to MoveSpeed Less 1.įinally, create two Transitions between Idle and Talk. ![]() Similarly, create two more Transitions between Walk and Run. Between the Idle and Walk animations, create two Transitions (right click on one, and choose the other, to make a Transition).įor the Idle → Walk Transition, set the Condition to MoveSpeed Greater 0.1.įor the Walk → Idle Transition, set the Condition to MoveSpeed Less 0.1 We'll use the MoveSpeed float to determine which of out the Idle, Walk and Run animations to play, but we want to keep our character still if the float is very small. ![]() For the "Character Pack: Free Sample" asset, we'll make use of the provided animations:ĭrag these clips into your Animator window, and make "idle" the default by right-clicking on it and choosing Set as layer default state:ĭefine two Parameters: a Float called MoveSpeed, and a Bool called IsTalking. Double-click the Animator Controller asset file to open the Animator window.Īn AC Player or NPC typically uses a set of Idle, Walk, Run and Talk animations. The animations used by the "Character Pack: Free Sample" asset do not rely on root motion, so uncheck Apply Root Motion in the Animator if you make use of them. Then assign it to your model by dragging it onto your character model's Controller field in the Inspector. If you don't already have one, you can create it in the Project window by choosing Create → Animator Controller in the toolbar. We'll need to supply an Animator Controller to drive the model's animations. In the case of the asset mentioned above, this is the MaleFree1 prefab: ![]() Regardless of whether you are making a Player or NPC, begin by dragging your character model or prefab into the scene. This tutorial makes use of the Character Pack: Free Sample animated character on the Unity Asset Store, but the steps involved work for any Mecanim-ready character model. For more information about working with Unity's Animator (Mecanim) system, see here. This tutorial is focused on taking a Mecanim-ready character model and integrating them into Adventure Creator. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |