Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public void CreateObject()
  2. {
  3. if (_target.active==true)
  4. {
  5. if (objects.Length > 0)
  6. {
  7. Instantiate(objects[0], new Vector3(_target.transform.position.x, _target.transform.position.y+ FindNewPos(), _target.transform.position.z), Quaternion.identity);
  8. Debug.Log(PosNewObject);
  9. }
  10. }
  11.  
  12. }
  13. private float FindNewPos()
  14. {
  15.  
  16. if (MultyRayCast(_target.transform.up, Color.red))
  17. {
  18. return PosNewObject = hit.collider.GetComponent<Renderer>().bounds.size.y/2;
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement