SHARE
TWEET

Untitled

a guest Feb 21st, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void OnControllerColliderHit(ControllerColliderHit hit)
  2. {
  3.     Rigidbody body = hit.collider.attachedRigidbody;
  4.  
  5.     if (body == null || body.isKinematic)
  6.         return;
  7.  
  8.     if (hit.moveDirection.y < -.3f)
  9.         return;
  10.  
  11.     Vector3 pushDirection = new Vector3(hit.moveDirection.x, 0, hit.moveDirection.z);
  12.     body.velocity = pushForce * pushDirection;
  13. }
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