SHARE
TWEET

raycast

a guest Jun 25th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 if (Physics.Raycast(ray, out RaycastHit raycastHit, 100f, raycastLayer)) {
  2.                     MoveableObject objectHit = raycastHit.collider.GetComponent<MoveableObject>();
  3.  
  4.                     if (objectHit.ReachedTarget == false) {
  5.        
  6.                         hitPoint.transform.position = raycastHit.point;
  7.                         hitPoint.transform.parent = objectHit.transform;
  8.                         AddForceAtPosition = true;
  9.  
  10.                     }
  11.                 }
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