Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by Koyemsi · Dec 09, 2019 at 03:26 PM · itweenworld space

iTween : moving along path, within a rotating reference frame

Hi, trying to do something quite tricky.

I want to move a missile along a predefined path with iTween. Nothing tricky here, except that I want this to happen inside a rotating environment. For some reason, all of my game objects stand in an empty game object which constantly spins, as if the world space itself was in motion.

I found a way to handle this (for those interested, more details at the end of this message), but there is one last problem I could’nt solve : the orientation of the missile. I want it to orient along its path, so I use the orienttopath parameter. This works perfectly in a static world, but not in a rotating one. I need my orientation to be « local », that is to say relative to the path space, not to the world space. Any way to do this ?

Thanx in advance and congratulations to the iTween’s author. I keep beeing amazed by the way this nice asset empowers Unity and celebrates the beauty of mathematics !


To translate along path within a moving reference frame :

  • Make an empty GO with a script that moves or rotates it. This will stand for your « moving world », and all of your GO’s should be childed to it.

  • For each point on the path, instantiate navpoints. These are simple Transforms that you will also child to the « rotating world », so that their positions keep being updated. It is important to make a navpoint for the start of the path and one for its end, not only for the intermediate points.

  • Store their localPositions in an array of Vector3. This will be your path.

  • Use iTween.MoveTo() as described in the example below. The « orienttopath » param should be set to false, until someone solves this specific problem

    Some code example :

Vector3[] path = new Vector3[] { startPoint.localPosition, navPoint1.localPosition, navPoint2.localPosition, endPoint.localPosition, }; iTween.MoveTo(myGameObject, iTween.Hash( "path", path, "time", 3f, "orienttopath", false, "islocal", true, "movetopath", false));

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

0 Replies

· Add your reply
  • Sort: 

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

116 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

iTween with multiple ValueTo calls on same GameObject 1 Answer

iTween PointOnPath percentage 3 Answers

Push an object along a path? 2 Answers

Enemy following the target with ITween 2 Answers

iTween & Boo 1 Answer


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