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 Chris12345 · Mar 22, 2013 at 02:15 AM · itweenplaymaker

Unity Itween error

How can this be solved, and what is the problem? error:

MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. UnityEngine.GameObject.GetComponents (System.Type type) iTween.Stop (UnityEngine.GameObject target, System.String type) (at Assets/iTween/Plugins/iTween.cs:6436) HutongGames.PlayMaker.Actions.iTweenFsmAction.OnExitiTween (HutongGames.PlayMaker.FsmOwnerDefault anOwner) (at Assets/PlayMaker/Actions/iTween/iTweenFsmAction.cs:64) HutongGames.PlayMaker.Actions.iTweenMoveTo.OnExit () (at Assets/PlayMaker/Actions/iTween/iTweenMoveTo.cs:110) HutongGames.PlayMaker.FsmState.OnExit () HutongGames.PlayMaker.Fsm.ExitState (HutongGames.PlayMaker.FsmState state) HutongGames.PlayMaker.Fsm.Stop () HutongGames.PlayMaker.Fsm.OnDisable () PlayMakerFSM.OnDisable ()

Comment
Add comment · Show 1
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 Chris12345 · Mar 22, 2013 at 02:26 AM 0
Share

found where the error is co$$anonymous$$g from, but i need help to solve it public static void Stop(GameObject target, string type){ Component[] tweens = target.GetComponents(typeof(iTween)); foreach (iTween item in tweens){ string targetType = item.type+item.method; targetType=targetType.Substring(0,type.Length); if(targetType.ToLower() == type.ToLower()){ item.Dispose(); } } }

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Disastercake · Mar 22, 2013 at 03:39 AM

I believe this error is called when you destroy an object that is currently using an iTween. iTween isn't very friendly in this situation, and doesn't bother to check if the object has been destroyed. I think the only way you can really avoid this is to stop all iTweens on the object that you are destroying. It looks like you're using Playmaker, so check if there is a premade action that can remove all iTweens on the object. If there is not, you may want to post on the Playmaker forums about this so they can create one for you.

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 Chris12345 · Mar 22, 2013 at 01:22 PM 0
Share

Thanks a lot

avatar image
0

Answer by Chris12345 · Mar 22, 2013 at 02:08 PM

How can i check if this is null, still not working.

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 BBoldenow · Aug 19, 2014 at 11:49 AM 0
Share

If you're still not working, I had to modify iTween itself to get $$anonymous$$e to work. I was not destroying the object the call was on, but StopByName (or in your case, Stop) was breaking anyways. I added a null check to that function in iTween and it fixed my problem.

avatar image
0

Answer by hm_occupe · Nov 16, 2020 at 11:07 PM

if any one still having this problem in ITween this is my solution:

Edit the ITween.cs File (/Plugins/Pixelplacement/iTween/iTween.cs) At line 6150 public static void StopByName(GameObject target, string name){ //Add This Line `` if (target == null) return; Component[] tweens = target.GetComponents(); foreach (iTween item in tweens){ /string targetType = item.type+item.method; targetType=targetType.Substring(0,type.Length); if(targetType.ToLower() == type.ToLower()){ item.Dispose(); }/ if(item._name == name){ item.Dispose(); } } }

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

14 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

Related Questions

NGUI - Simulate a button press from script 3 Answers

itween add null checker 1 Answer

New UI Issues. 0 Answers

Playmaker: How to use transform.position in actions 2 Answers

iTween change loop type with Playmaker 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