Hello ! I wanted to implement turning animations to my NavMesh AI using a blend tree, i couldn't achieve this. On a Unity forum post i found a script that basically gets the rotation speed and the speed.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AngularVelocity : MonoBehaviour
{
[SerializeField] float speed;
[SerializeField] float turn;
// Update is called once per frame
void Update()
{
var mAgent = GetComponent<UnityEngine.AI.NavMeshAgent>();
Vector3 s = mAgent.transform.InverseTransformDirection(mAgent.velocity).normalized;
speed = s.z;
turn = s.x;
}
}
I edited it a little bit. I want to change the animator floats by using Playmaker.
I tried to use "GetProperty", but there are no options for variables.
The only options are : Enable, HideFlags, IsActiveAndEnbaled, RunInEditMode, UseGUILayout and Name > String, Length.
Can someone help me ?
PS : It's my first post so if there are any errors, please tell me.