- Home /
I need to create an explosion in front of a charactor controller.
I have a character controller, and an explosion script, and I need to add a prefab at a given point in front of it, I will be using a gui.button, but that is not necessary, I can add that in later. I am also on a mobile platform, and i know the problems of using a gui.button on mobile, but this should not need multi-touch with the buttons. Thanks in advance.
This is Unity answers website. You did not even asked a question -__-
I don't know how to add that so it creates a prefab, That was my question, sorry if I did not make that clear enought.
put this on the camera and it will spawn yourPrefab in front of the camera and store the new game object in object handler.
void OnGUI(){ if (GUI.Button(new Rect(10, 70, 50, 30), "Click")) objectHandler = Instantiate(yourPrefab,transform.position + transform.forward,transform.rotation) as GameObject; }
Lol @GrnDyRx! $$anonymous$$iraSensei is spot on.
while (question$$anonymous$$arkIsNotFound)
{
read your post
}
Your answer
Follow this Question
Related Questions
Perform Action on frame/time of animation 1 Answer
How to make mobile controls shoot prefab bullets 0 Answers
Making 2D On screen buttons for movement 0 Answers
Checking Position 1 Answer