From 6ce8b9e22fc13be34b442c7b6af48b42cd44275a Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Wed, 13 Mar 2024 11:00:58 +0800 Subject: +init --- FollowTransformVelocity.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 FollowTransformVelocity.cs (limited to 'FollowTransformVelocity.cs') diff --git a/FollowTransformVelocity.cs b/FollowTransformVelocity.cs new file mode 100644 index 0000000..584846c --- /dev/null +++ b/FollowTransformVelocity.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +public class FollowTransformVelocity : MonoBehaviour +{ + public TransformVelocity transformVelocty; + + private void Start() + { + } + + private void FixedUpdate() + { + base.transform.position = transformVelocty.transform.position + transformVelocty.velocity * 5f; + base.transform.rotation = transformVelocty.transform.rotation; + } +} -- cgit v1.1-26-g67d0