Ledger Nano X - The secure hardware wallet
SHARE
TWEET

TrackerLerp

a guest May 24th, 2019 17 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class TrackerLerp : MonoBehaviour {
  6.     public Transform target;
  7.     public float targetFPS = 90.0f;
  8.     public float influence = 0.985f;
  9.  
  10.     void LateUpdate () {
  11.         float timeScale = 1.0f / targetFPS;
  12.         float factor = influence * (Time.deltaTime / timeScale);
  13.         transform.position = Vector3.Lerp(transform.position, target.position, factor);
  14.         transform.localScale = Vector3.Lerp(transform.localScale, target.localScale, factor);
  15.         transform.rotation = Quaternion.Slerp(transform.rotation, target.rotation, factor);
  16.     }
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top