- Home /
how to create a popping out object ?
I'm new to unity and have only created 1 other game before so please cut me some slack!I want an object to pop out at you and when you hit/press the object it gets destroyed? I am okay with the destroy part (that's fairly basic) but how would I the object pop out? I also want the object to get bigger when it pops out, but it is not the most important question? Thanks in advance!!
At what point would you like the object to pop out? When you walk near it? When you click on it?
Please don't try and ask the same question twice. If you are not getting an answer with in a reasonable amount of time (24 to 48 hours), you can add a comment to your question with the word "bump." This will place it in the top of the queue. In addition, you should respond to the comments and answers you've already received on how the do or do not work for you.
Answer by ebogguess · Jul 02, 2013 at 04:53 PM
When you say "pop out" do you mean, you want to create an object that comes toward the camera/player? If so, you can get the direction from the object to the camera by subtracting their position vectors, and move the object along that vector by a predetermined amount. The object will appear larger as it grows closer to the camera, which sounds like the effect you want.
Answer by NicoLocke · Jul 02, 2013 at 07:23 PM
I would create an animation, then you can either play the animation automatically on start or trigger the animation with a function (OnMouseDown, OnCollision etc).
The animation could consist of the object "popping out" by moving on the Y axis over time.
To make the object get bigger, you can scale the object up with in the same animation.
Here is an introduction video on animation...
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
obect will not appear in scene 0 Answers
Projecting created objects? 2 Answers
What is the concept of "object" class (not gameObject, just object) in Unity scripting? 3 Answers
Drag Rigid Body No Distance Limit and how to add Mouselock to a scrip 1 Answer