Tanoda
PhysicsTracker.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4
5public class PhysicsTracker : MonoBehaviour
6{
7 private PhysicsHand follow;
8
9 public Vector3 offset;
10 public Vector3 offsetRotation;
11
12 public void FollowThis(PhysicsHand hand) => follow = hand;
13
14
15 void FixedUpdate()
16 {
17 if (follow)
18 {
19 follow.MoveTo(transform.position + offset, transform.rotation * Quaternion.Euler(offsetRotation));
20 }
21 }
22}
void MoveTo(Vector3 position, Quaternion rotation)
Definition: PhysicsHand.cs:31
Vector3 offsetRotation
void FollowThis(PhysicsHand hand)