Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 55 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. for(var touch: Touch in Input.touches){
  2.     if(touch.phase == TouchPhase.Stationary){
  3.         this.rigidbody.isKinematic = true;
  4.     }else if(touch.phase == TouchPhase.Ended){
  5.         this.rigidbody.isKinematic = false;
  6.     }else if(touch.phase == TouchPhase.Moved){
  7.         moveVector = startPos - touch.position;
  8.     }
  9.  
  10.     if(inverted == false){
  11.         this.rigidbody.AddForce(-moveVector.normalized,ForceMode.Impulse);
  12.     }else if(inverted == true){
  13.         this.rigidbody.AddForce(moveVector.normalized,ForceMode.Impulse);
  14.     }                  
  15. }
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