- Home /
Null Ref Error with Playmaker and iTween
I have a simple prefab created with my character, two cubes that are used for waypoints to patrol, and one large cube used as a trigger to tell that character to chase after the player. When I have this prefab in the scene by himself there are no problems. However when I place that prefab into another prefab within the scene I start getting constant Null Ref errors, all coming from iTween.
NullReferenceException: Object reference not set to an instance of an object
iTween.RetrieveArgs () (at Assets/Plugins/iTween/iTween.cs:6788)
iTween.Awake () (at Assets/Plugins/iTween/iTween.cs:6538)
UnityEngine.GameObject:AddComponent(String)
iTween:Launch(GameObject, Hashtable) (at Assets/iTween/Plugins/iTween.cs:6740)
iTween:MoveTo(GameObject, Hashtable) (at Assets/iTween/Plugins/iTween.cs:1448)
HutongGames.PlayMaker.Actions.iTweenMoveTo:DoiTween() (at Assets/Scripts/PlayMaker/Actions/iTween/iTweenMoveTo.cs:177)
HutongGames.PlayMaker.Actions.iTweenMoveTo:OnEnter() (at Assets/Scripts/PlayMaker/Actions/iTween/iTweenMoveTo.cs:106)
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:Start()
PlayMakerFSM:Start()
NullReferenceException: Object reference not set to an instance of an object
iTween.CallBack (System.String callbackType) (at Assets/Plugins/iTween/iTween.cs:7031)
iTween.TweenStart () (at Assets/Plugins/iTween/iTween.cs:4585)
iTween+<Start>c__Iterator2.MoveNext () (at Assets/Plugins/iTween/iTween.cs:6546)
NullReferenceException: Object reference not set to an instance of an object
iTween.LateUpdate () (at Assets/Plugins/iTween/iTween.cs:6589)
The only place I am using iTween is within some of the playmaker scripts I have made. The Playmaker script simply uses iTween Move To to move to one point and once it gets there it uses it again to move back. Once the character enters the trigger collider it then goes into the chase state where I use iTween Move Update to move toward the player. The players object is stored in a global variable and the chase script uses that global variable. The other two points used for the pathing are just cube objects within the prefab of the character.
Has anyone run into this before, or have any ideas as to what might be causing the issue? Also if you need any additional information just let me know and I will get you anything you need.
You had any luck with this? I've had an almost identical problem and I can't for the life of me figure out what he issue is.
i'm still having this problem , iTween adds too many components too my gameobject. it is a really annoying problem. and i can't get new iTween through assetstore (since our country is restricted) , so i have an old version of iTween downloaded from github. if anyone have new iTween and could upload it somewhere for me i would appreciate it, or if anyone found a solution for this problem.
Answer by SubatomicHero · Jul 26, 2013 at 12:08 PM
Check the object that is performing the iTween animations. I had this error where there were many instances on iTween scripts attached to the objects at the editor level.
I cannot vote it up yet but this was the solution for me. I don't know why there were so many iTween components attached to my GameObject in the editor, my only guess is that a Play$$anonymous$$aker update must have been gone wrong somehow. Removing all those iTween components made the error go away and everything works now as expected.
UPDATE: problem is there again. $$anonymous$$y prefab instance gets an additional script attached whenever another gameobject uses it in a iTweenRotateTo FS$$anonymous$$ action. :/
Your answer
Follow this Question
Related Questions
itween add null checker 1 Answer
NGUI - Simulate a button press from script 3 Answers
New UI Issues. 0 Answers
Unity Itween error 3 Answers
Playmaker: How to use transform.position in actions 2 Answers