Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Transform target;
- public float smoothSpeed;
- public Vector3 offset;
- public bool ignore;
- void Start()
- {
- target = GameObject.Find("redPlayer").GetComponent<Transform>();
- }
- void LateUpdate ()
- {
- Vector3 desiredPosition = target.position + offset;
- Vector3 smoothedPosition = Vector3.Lerp(transform.position, desiredPosition, smoothSpeed * Time.deltaTime);
- transform.position = smoothedPosition;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement