From 7f493f682503f5186308de7b8f74b5b49233cfe4 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Thu, 2 Nov 2023 11:51:31 +0800 Subject: +init --- GameCode/RacerRoll.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 GameCode/RacerRoll.cs (limited to 'GameCode/RacerRoll.cs') diff --git a/GameCode/RacerRoll.cs b/GameCode/RacerRoll.cs new file mode 100644 index 0000000..bb85388 --- /dev/null +++ b/GameCode/RacerRoll.cs @@ -0,0 +1,16 @@ +using Pathfinding.RVO; +using UnityEngine; + +public class RacerRoll : MonoBehaviour +{ + public RVOController rvo; + + public float speedMultiplier = 90f; + + public Transform targetTransform; + + private void Update() + { + targetTransform.Rotate(rvo.velocity.sqrMagnitude * speedMultiplier * Time.deltaTime, 0f, 0f, Space.Self); + } +} -- cgit v1.1-26-g67d0