Guest User

Untitled

a guest
Jan 16th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public GameObject wordPrefab;
  2. public Transform wordCanvas;
  3.  
  4. public WordDisplay SpawnWord()
  5. {
  6. Vector3 randomPosition = new Vector3(Random.Range(-2.0f, 2.0f), 7.0f, 0);
  7. GameObject wordObj = Instantiate(wordPrefab,randomPosition, Quaternion.identity, wordCanvas);
  8. WordDisplay wordDisplay = wordObj.GetComponent<WordDisplay>();
  9. return wordDisplay;
  10. }
Add Comment
Please, Sign In to add comment