Hi guys,
I’m having trouble moving one object to another objects position… Im pretty sure it has to do with Vector3 stuff but i just dont understand it and what I’m doing wrong, can anyone help?
cheers
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class follow : MonoBehaviour {
public GameObject cam;
public GameObject goal;
private Vector3 velocity = Vector3.zero;
public float smoothTime = 0.3F;
// Update is called once per frame
void Update () {
cam.transform.position = Vector3.SmoothDamp(transform.position, goal, ref velocity, smoothTime);
}
}