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
0
Question by dwu · Jan 17, 2012 at 02:41 PM · instantiateitweenitweenpath

No appropriate version of 'iTween.PutOnPath' for argument list ... was found

I'm trying to instantiate and then place an object on a path and allow the user to move the object along the path. I'm using iTween without success and have been trying various things for a week (I'm new to this). I confirmed that I've iTween, iTweenPath, and iTweenPathEditor in my Plugins folder (I notice that Mono editor still doesn't recognize the iTween functions as I type). Unity is giving me this error:

Assets/Mellon/Scripts/Object Path Script.js(2,25): BCE0023: No appropriate version of 'iTween.PutOnPath' for the argument list '(System.Type, System.Collections.Hashtable, int)' was found.

This is my GUI Script.js

 //This script instantiates objects using the GUI
 
 var prefab1 : GameObject;
 var prefab2 : GameObject;
 var prefab3 : GameObject;
 var prefab4 : GameObject;
 var prefab5 : GameObject;
 
 function OnGUI () {
     // Make a background box
     GUI.Box (Rect (10,10,100,240), "Create Bead");
 
     // Make the first button. If it is pressed, Round Sm bead will be created
     if (GUI.Button (Rect (20,40,80,30), "Round Sm")) {
         //Instantiate the object at the position and rotation of this transform
         var instance1 : GameObject = Instantiate(prefab1, Vector3(10,50,-20), transform.rotation);
     }
 
     // Make the second button. If it is pressed, Round Lg bead will be created
     if (GUI.Button (Rect (20,80,80,30), "Round Lg")) {
         var instance2 : GameObject = Instantiate(prefab2, Vector3(10,50,-20), transform.rotation);
     }
 
     // Make the third button. If it is pressed, Rondel bead will be created
     if (GUI.Button (Rect (20,120,80,30), "Rondel")) {
         var instance3 : GameObject = Instantiate(prefab3, Vector3(10,50,-20), transform.rotation);
     }
 
     // Make the fourth button. If it is pressed, Oval Sm bead will be created
     if (GUI.Button (Rect (20,160,80,30), "Oval Sm")) {
         var instance4 : GameObject = Instantiate(prefab4, Vector3(10,50,-20), transform.rotation);
     }
     
     // Make the fifth button. If it is pressed, Oval Lg bead will be created
     if (GUI.Button (Rect (20,200,80,30), "Oval Lg")) {
         var instance5 : GameObject = Instantiate(prefab5, Vector3(10,50,-20), transform.rotation);
     }
 
 }

This is Object Path Script.js

 function Update () {
     iTween.PutOnPath(GameObject, iTween.Hash("path", iTweenPath.GetPath("beadstring")), 0);
 
     }

Any suggestions what for needs to be changed? Thanks!

Comment
Add comment · Show 2
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 BiG · Jan 17, 2012 at 02:51 PM 0
Share

I've never used iTween, but...Script.js is attached to the object that you want to move, right? So, try with gameObject as parameter, and not GameObject...Hoping to have understood the logic.

avatar image dwu · Jan 17, 2012 at 04:15 PM 0
Share

I'm thinking it may have to do with iTween not being set up properly too. When I watch the video (http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/), $$anonymous$$ono recognizes and finds the functions as Bob types (e.g., $$anonymous$$oveTo, etc.) but $$anonymous$$e doesn't.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Russ Morris · Jan 17, 2012 at 06:52 PM

 function Update () {
 iTween.PutOnPath(GameObject, iTween.Hash("path", iTweenPath.GetPath("beadstring")), 0);

 }

So, see the bit where you have GameObject... well you're declaring a Type there, not an actual gameObject.

Change GameObject to gameObject so that it refers to the gameObject instead...,, function Update () { iTween.PutOnPath(GameObject, iTween.Hash("path", iTweenPath.GetPath("beadstring")), 0);

 }

Check where it says GameObject, it should say gameObject for a start, no?

Comment
Add comment · 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
0

Answer by dannyskim · Jan 17, 2012 at 06:23 PM

You're using the

 iTween.Hash();

method of creating your hash table which is only supported in the c# version of iTween I believe. You need to call it using the inline Hash table creation method for javascript:

http://itween.pixelplacement.com/gettingstarted.php

I'm not quite sure how using GetPath would work with it all, so you may have to experiment with that.

Comment
Add comment · 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
0

Answer by abelegu2 · Apr 15, 2015 at 01:07 PM

It appears you're just using the function the wrong way. According to iTween's Documentation, PutOnPath only accepts the following parameters in the order shown:

  • PutOnPath(GameObject target, Vector3[] path, float percent)

  • PutOnPath(GameObject target,Transform[] path, float percent)

  • PutOnPath(Transform target, Vector3[] path, float percent)

  • PutOnPath(Transform target, Transform[] path, float percent)

You used:

  • iTween.PutOnPath(GameObject, iTween.Hash("path", iTweenPath.GetPath("beadstring")), 0);

...and PutOnPath does not take the HashTable parameter you used (i.e. iTween.Hash). I would suggest using something else (such as iTween.MoveTo function, which does use HashTables), but you know best what you need your code to do. Refer to the documentation for more information on iTween functions.

Comment
Add comment · 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

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

8 People are following this question.

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

Related Questions

Problems with iTween and Instantiating objects 2 Answers

using iTween in Update() for greater control 2 Answers

iTween Get the path from object nodes and move the object at same speed by loop 1 Answer

Orienting to path for iTween.PutOnPath function 0 Answers

iTween 2D Path rotation 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