|
Hello again, This time im trying to create a prefab in javascript, I created my Prefab in the project and want to place it on the screen by javascript. could someone please give me a piece of code that creates a new prefab (copy the one from the the project folder)? Kind Regards, TheMPC
(comments are locked)
|
|
Thank you for the first answer this gave me alot, but not the complete answer. After fooling around with your answer i figured out i had to do the following:
And link the prefab i want to create to the prefab var in the script. nearly the same as the first answer, although i got alot of errors because i was using exacly what the answer stated.
(comments are locked)
|
|
Instantiate(transform,position,rotation) where transform is the prefab. For instance: var player : Transform; Function Start() { Instantiate(player,new Vector3(0,0,0),transform.rotation) }
(comments are locked)
|
