- Home /
spawn prefab on mouse up
i want to be able to press a name in the pic below and have an prefab spawn and fly out of the volcano
thanks
Are those names GUI labels or text meshes? I can see a little bit of inward rotation on a few of them, so those are obviously text meshes. But are all of them text meshes? Depending on what they are, you'd need a different way of getting input from them. For a text mesh, you simply have to add a collider to it and perform a raycast from the mouse click position to check if it hit the collider. For a GUI label that's been rotated though, you'd have to do some matrix calculations behind the scenes which is just nasty. XD
Answer by Anxo · Jun 22, 2011 at 07:46 PM
You are able =)
what is your question? If you are looking for information on how to have a prefab spawn, look for how to use "Instantiate" in the scripting references. If you are looking on how to do mouse events, look for "Mouse" in the scripting reference.
If you have a specific question, feel free to ask and we will be happy to answer.
Your answer
Follow this Question
Related Questions
Make a object spawn 1 Answer
Player spawn after touching 0 Answers
spawning a prefab that have animation 1 Answer
Prefab spawning without running script (uses VR controllers) 1 Answer