Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public void testCreateObject() // Testing Instantiate
  2. {
  3. float x = Random.Range(-3, 3);
  4. float y = Random.Range(-3, 3);
  5.  
  6. Vector3 position = new Vector3(x, y, 0);
  7.  
  8. Debug.Log("Before Instantiate");
  9. GameObject obj = GameObject.Instantiate(sourceObject, position, Quaternion.identity);
  10. Debug.Log("After Instantiate");
  11.  
  12. obj.transform.SetParent(playSpace);
  13. Debug.Log("After SetParent");
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement