Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Physics.Raycast(ray, out RaycastHit raycastHit, 100f, raycastLayer)) {
- MoveableObject objectHit = raycastHit.collider.GetComponent<MoveableObject>();
- if (objectHit.ReachedTarget == false) {
- hitPoint.transform.position = raycastHit.point;
- hitPoint.transform.parent = objectHit.transform;
- AddForceAtPosition = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement