Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // instance variable
- Vector3 lastPos;
- void Start() {
- lastPos = transform.position;
- }
- void Update() {
- Vector3 velocity = (transform.position - lastPos) / Time.deltaTime;
- lastPos = transfrom.position;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement