1 using System.Collections;
2 using System.Collections.Generic;
13 [RequireComponent(typeof(Animator))]
17 private Animator animator;
18 private Vector3 lastPos = Vector3.zero;
23 public string speedAnimationParameter =
"Speed";
25 protected override void Start()
28 animator = GetComponent<Animator>();
30 animator.logWarnings =
false;
32 lastPos = playerRig.FeetInWorldSpace;
37 if(!this.enabled) Debug.Log(
"????????????");
39 animator.SetFloat(speedAnimationParameter, playerRig.AvgMotion.magnitude);
41 if(playerRig.AvgMotion.magnitude > 0.3f) {
42 transform.forward = Vector3.Lerp(transform.forward, playerRig.AvgMotion, 0.05f);
46 transform.forward = Vector3.Lerp(transform.forward, playerRig.XZPlaneFacingDirection, 0.05f);
49 if(Vector3.Distance(lastPos, playerRig.FeetInWorldSpace) > 0.1f) {
50 lastPos = Vector3.Lerp(lastPos, playerRig.FeetInWorldSpace, 0.1f);
53 transform.position = lastPos;
Sets the documentation html file inside of Packages/com.avr.core/Documentation/html of a given class...
Avatar component that doesn't require controllers.