17 lines
424 B
C#
Executable File
17 lines
424 B
C#
Executable File
using UnityEngine;
|
|
|
|
public class HighSpeedTrainPass : MonoBehaviour
|
|
{
|
|
Vector3 moveTo;
|
|
public Transform target;
|
|
|
|
public float speed = 1.0f;
|
|
|
|
Transform current;
|
|
|
|
void FixedUpdate() {
|
|
current = GetComponent<Transform>();
|
|
transform.position = Vector3.MoveTowards(current.position, target.position, speed * Time.fixedDeltaTime); // i think this will be the best way to do it (for now)
|
|
}
|
|
}
|