• 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 testure · Jun 18, 2011 at 08:05 PM · itweenpercentageputonpath

iTween PutOnPath normalize percentage based on path length, not node-count?

Currently, if you use iTween.PutOnPath() it takes a path of vector3's, and a percentage of the path to put the gameobject on. However- that percentage doesn't seem to be based on the length of the path, but the number of nodes in your path.

For example, if I make a really long S shape, where there is a tight turn at the top and bottom, but a long straight area between the two- iTween wants to move the object really fast on the straight area, but really slow on the curves. This is because the percentage it's taking is interpreted as the percentage of "nodes", not the actual percentage of the path.

Has anybody run into this issue and found a workaround? Right now I'm getting around it by just adding a bunch of extra nodes to the path to make them evenly distributed, and that works- it just adds a ton of unnecessary nodes to the path. Is there something in iTween that does this natively that I might have overlooked?

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
2
Best Answer

Answer by testure · Jun 19, 2011 at 05:04 AM

The answer is- you can't do it. You have to add more nodes to even things out.

Ultimately, I ended up implementing my own catmull-rom spline system because I needed more control than what iTween was giving me.. so mine is very streamlined to my purposes and calculates the percentage of a path based on the length of the spline.

Comment
Add comment · Show 1 · 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 xandermacleod · May 23, 2014 at 12:23 PM 0
Share

could you provide an example of your work around? I'm experiencing the same problem, but doing more nodes isn't an option for me, as the reason why im using iTween in the first place is to avoid needing to dynamically create a whole heap of 'node' equivalents.

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.

Welcome to Unity Answers

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.



Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

iTween Put On Path percentage 0 Answers

iTween.PutOnPath similar function for LeanTween or DoTween 1 Answer

iTween : Move Just a Small Portion of a Path? 2 Answers

How to create homing missile that follows path using Unity and iTween 1 Answer

iTween: uneven looping with PutOnPath 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges