- Home /
Making objects "bounce"
I'm currently working with a group of cube (Game Objects) and when the player interacts with it I am trying to have it "bounce" and slightly go down on the y-axis and come back up in the span of 1 second. I successfully applied this to one cube and now I doing the same for all the other cubes but for some reason the other cubes will not only animated on the y axis but also on the x-axis (even though I haven't even touched that part of the transform part in the animation window.
Does anyone know how to make this cube drop without it swirling all over the place?
::edit:: I have already checked the orientation of the game object and the y axis is what is supposed to be moving :)
Thanks!
[3]: http://answers.unity3d.com/storage/temp/809-Screen+Shot+2012-05-03+at+1.30.43+PM.png
Im going to take a stab at this with the info given. From the looks of it, this game is 2d. Do you have rigidbodies attached to the objects? Are you actually using the physics to create the bounce? Or are you just animating them? If youre using the rigidbodies, youll have to lock the rotations of the objects.
Yeah, the game is 2D and I'm not using physics to create the bouncing effect I'm animating them to make them look like they are bouncing. Essentially just moving it along the Y axis slightly so when the play touches that node, it will depress like a button would.
you can do this simply by scripting with out physics using only by movements. check once iTween for movements, it'll give the same what you're trying with animations.
Answer by mister.keith · Jun 02, 2012 at 08:29 PM
I ended up using the Punch effect on iTween thanks to sriram90. Worked the way I wanted it with minimal effort. Thanks for the help!
Answer by stingman · May 04, 2012 at 06:39 AM
Animations can be tricky. Sometimes it just takes a lot of playing around but first:
Check each frame of the animation and look at the X position. If the x position of your cube is not where it's supposed to be then move it back to your desired position and record over that keyframe. Might seem time consuming but it works.
You could also just script this effect quite easily. For what you're trying to do I would suggest just doing it in code unless there's something specific you're trying to accomplish in the animation.
Answer by Wolfram · Jun 02, 2012 at 09:05 PM
In the animation window, click on the red mark next to "position.x", and choose "delete key". Do the same for "position.z". Now the animation will only modify the y values.
Woops, I meant "delete key", not "delete curves". I fixed it in my answer.
Your answer
Follow this Question
Related Questions
Can the animation editor create local rotational data? 3 Answers
Adding animation clips via script 2 Answers
Can I make animations snap to a frame? 1 Answer
How to select an animation clip by index number? 7 Answers
how to collide .fbx animation in unity 0 Answers