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 IRetrograde · Dec 14, 2011 at 08:58 PM · instantiateitweenproject structure

Problems with iTween and Instantiating objects

Hi there!

I'm pretty new to Unity (few months) and I've been mostly just hacking my project together to try to get it to an MVP status.

When I started my project, i just started spawning everything in the editor and referencing them in script through builtin arrays. Now, I went to clean up some stuff and I started running into all sorts of issues. This started because I changed how I was instantiating/referencing objects from script to now I instantiate the objects on startup vs. in the editor.

Basically, if my objects have iTween.Init(this.gameObject) inside of the Start() functions, I get a ton of the following problems when calling Instantiate on them:

  • My console starts telling me that a lot of objects have NullReferenceExceptions in the RetrieveArgs().

  • After that, it just spews a series of LateUpdate() and TwenUpdate() errors since the id of the object was null in the RetrieveArgs() iTween call... not sure why since the object is valid...

So, I remedied that a little by shoving the iTween.Init call inside of an Initialize function in every object that I want to use. However, during run time, when I go to Destroy/Instantiate another object, I get problems..

My questions are as follows:

  • Should I just go back and keep things using builtin arrays and not do any instantiating/creation during run time? Although before was more efficient, I'm just trying to know what it's considered as "clean" by Unity standards...

  • Should objects that use iTween be mutually exclusive to objects that are created by using the Instantiate() method?

  • Could someone perhaps provide me an answer about what's going on behind the scenes with iTween and the Instantiate() method?

Cheers!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by jeepcreep · Mar 22, 2016 at 01:48 PM

I know this comes a few years late but I had the same issues and the NullReferenceExceptions only went away when I called

 iTween.Init(this.gameObject);

from within Awake() inside a script that is bound to a PreFab.

For anyone stumbling upon this issue, it might come in handy....

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 rpmobile · Jan 13, 2012 at 09:18 PM

I had the same issues as you.

I was following the docs/tutorials that mention that you should link a Prefab to a script by giving it a type of "Transform" in the script. When I changed it to a GameObject, I was able to use iTween with Instantiated prefabs.

I had the same TetrieveArgs() exception, but that was due to my accidentally Instantiating an object twice. I Instantiated, then executed the iTween command,and later in my script I was Instantiating and assigning to the same object. I fixed this by removing the 2nd one.

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

6 People are following this question.

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

Related Questions

Local Position 0,0,0 on Instantiate without Parent 0 Answers

iTween help needed 2 Answers

How do I "instantiate" a path with iTween? 1 Answer

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

Problem with iTween and instantiated path 0 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