Hi, I'm trying to simulate a simple bottle bobbing in the water. The bottle is loop moving left and right over a course of let's say 15 seconds. During this time I want the bottle to bob up and down 2 or 3 times as it moves across the screen. When using iTween it seems to only register one iTween moveTo call on an object. Is this correct or did I mess this up? Is there another way to achieve this with iTween or is this gonna have to be done with code? Thx.
Answer by pixelplacement
Jan 15, 2011 at 02:37 AM
You are doing things right.
iTween is meant to move one piece of an object's transform at a time since Unity requires an object's X,Y,Z all be set at the same time. To pull off the effect you want simply put your bottle in an empty game object, put a MoveTo on the bottle and this new holder -- one to move left and right and one for up and down.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
iTween - look for new path, move to or reverse at end?
Using iTween to chain multiple paths together
iTween moveby constrained by rigidbody constraints in Unity 5
iTween ValueTo not working
Go back to first node (itween + moveto)