22 lines
424 B
C#
22 lines
424 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class FollowPhysics : MonoBehaviour
|
|
{
|
|
public Transform target;
|
|
Rigidbody rb;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
rb = GetComponent<Rigidbody>();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void FixedUpdate()
|
|
{
|
|
rb.MovePosition(target.transform.position);
|
|
}
|
|
}
|