Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by NPS · Apr 23, 2013 at 05:03 PM · moveitweencircle

Move around a circle with iTween?

How can I move a GameObject around a circle using iTween? I need something like this: iTween.MoveXXX(). Is there any better way than using paths (because I image it would be possible to create a circular path)? I know it can be easily done with normal code (moving x and y with cos() and sin()) but there's a reason why I need to use iTween here.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by robertbu · Apr 23, 2013 at 06:01 PM

You can rotate an empty game object using iTween and make the object that you want to move in a circle a child of the empty game object with an offset that places it on the circular path.

As an alternate, since you understand how to move an object in normal code, you can use similar code to generate the path and then use iTween functions to walk along the path.

Comment
Add comment · Show 10 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image NPS · Apr 24, 2013 at 11:09 AM 0
Share

@robertbu I used your first advice but have a strange problem. First of all, I wanted to move sth around a circle because I have an object whose pivot isn't at its center but in its corner (so if I rotated this object around a circle it should appear as if being rotated by its center). So after using your 1. advice my object (now a child of a dummy empty object) seems to be being rotated around an oval path ins$$anonymous$$d of circular. :P I don't know if it's $$anonymous$$E doing sth wrong or if it's iTween's issue. :P

avatar image robertbu · Apr 24, 2013 at 01:29 PM 0
Share

You can try using a second empty game object. Place the second empty game object at the center of the object make the real object its child. $$anonymous$$ake the iTween rotated object the parent of the second game object.

avatar image NPS · Apr 24, 2013 at 02:09 PM 0
Share

So finally I would have another empty object in the very same position as the first one (positions of the first empty object and the real object same as before)? If so then I tried it and it didn't help (don't really know how that could help).

avatar image robertbu · Apr 24, 2013 at 08:41 PM 0
Share

You said you had an object where the pivot was not at the center. So the second empty game object goes at the center of the object, not the pivot point. So the visible game object will be offset from the empty game object by the distance between the pivot and the center of the game object.

avatar image NPS · Apr 24, 2013 at 09:06 PM 0
Share

http://postimg.org/image/jahwi52zx Black quad is empty game object 1, red quad is empty game object 2, green star is visible real object, 1. is empty objects' and rotation's pivot, 2. is real object's pivot. Is this what you meant?

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How would I go about moving a group of objects as one using iTween? 1 Answer

Can I move a component from one GameObject to another in script? 1 Answer

How can I scale and move a game object simultaneously using iTween? 0 Answers

How to animate a moving platform GameObject? 2 Answers

how to move or fade GUITextures with iTween 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges