A* Pathfinding Project
4.3.5
The A* Pathfinding Project for Unity 3D
|
Example of how to use Mecanim with the included movement scripts. More...
Example of how to use Mecanim with the included movement scripts.
This script will use Mecanim to apply root motion to move the character instead of allowing the movement script to do the movement.
It assumes that the Mecanim controller uses 3 input variables
Public Attributes | |
float | velocitySmoothing = 1 |
Protected Member Functions | |
override void | Awake () |
virtual Quaternion | RotateTowards (Vector3 direction, float maxDegrees) |
Calculates a rotation closer to the desired direction. More... | |
Protected Member Functions inherited from VersionedMonoBehaviour | |
virtual int | OnUpgradeSerializedData (int version, bool unityThread) |
Handle serialization backwards compatibility. More... | |
virtual void | Reset () |
Handle serialization backwards compatibility. More... | |
Private Member Functions | |
Vector3 | CalculateBlendPoint () |
Calculate position of the currently grounded foot. More... | |
void | OnAnimatorMove () |
void | Update () |
Update is called once per frame. More... | |
Static Private Member Functions | |
static Vector3 | RotatePointAround (Vector3 point, Vector3 around, Quaternion rotation) |
Private Attributes | |
IAstarAI | ai |
Cached reference to the movement script. More... | |
Animator | anim |
Cached Animator component. More... | |
Transform [] | footTransforms |
Cached reference to the left and right feet. More... | |
Vector3 [] | prevFootPos = new Vector3[2] |
Position of the left and right feet during the previous frame. More... | |
Vector3 | smoothedVelocity |
Transform | tr |
Cached Transform component. More... | |
Additional Inherited Members | |
Properties inherited from VersionedMonoBehaviour | |
int Util.IEntityIndex. | EntityIndex [get, set] |
Internal entity index used by #BurstBatchHelper. More... | |
Properties inherited from IEntityIndex | |
int | EntityIndex [get, set] |
|
protectedvirtual |
Reimplemented from VersionedMonoBehaviour.
|
private |
Calculate position of the currently grounded foot.
|
private |
|
staticprivate |
|
protectedvirtual |
Calculates a rotation closer to the desired direction.
direction | Direction in the movement plane to rotate toward. |
maxDegrees | Maximum number of degrees to rotate this frame. |
|
private |
Update is called once per frame.
|
private |
Cached reference to the movement script.
|
private |
Cached Animator component.
|
private |
Cached reference to the left and right feet.
|
private |
Position of the left and right feet during the previous frame.
|
private |
|
private |
Cached Transform component.
float velocitySmoothing = 1 |