How do i spawn an object with a button press?
Hi. I Want to make a script that spawns an object to a certain position with a button. A object imported from Maya. Thanks.
Answer by Tony_T · Aug 24, 2015 at 04:06 PM
There are many ways you can do that. You can ether have the object you want at the position you want but have it disabled and enable it on a button press. You can have an empty object on a position and make the object you want spawn on the empty object's position. Check the Object.Instantiate and note that since you are talking about a Maya model, make sure to create a prefab of that object so it spawns the way you want. If you don't have a prefab of the object the object will spawn without textures, colliders, etc.
Answer by Wolfshadow · Aug 24, 2015 at 03:55 PM
Use void start to move the gameobject when the game starts, and then move it to the spot needed with the built in unity button features. Move it with transform.Translate(x coordinate, y coordinate, z coordinate);
Your answer
Follow this Question
Related Questions
How to spawn randomly with multiple gameobject 2 Answers
Script Spawning Double? 1 Answer
How can I make an object clone in the time that I indicate it to appear? 0 Answers
Mesh Movement 0 Answers