- Home /
iTween nullref error. Hashtable syntax problem? Not sure.
Any help?
So, I've got this short little iTween script that moves something up and down. But it just throws null ref errors every time I run the game. There doesn't seem to be any logical explanation for why it stops--or why it throws the error. It's an instantiated "clone" of an original object. The object actually moves as it's supposed to. But there are still errors. And when I look for where the error is, it points to the line in iTween that states:
if(tweenArguments.Contains("looktarget") && isRunning){
It's line 6453. . Any idea what it could be? I feel like these are perfectly normal iTween calls...
Cheers private var floatTime = 4; private var floatDistance = 1;
function Awake()
{
iTween.MoveBy(gameObject, {"z" : floatDistance, "easetype" : "easeInOutCubic", "time": floatTime, "oncomplete" : "moveDown"});
}
function moveDown()
{
iTween.MoveBy(gameObject, {"z" : floatDistance * -1, "easetype" : "easeInOutCubic", "time": floatTime, "oncomplete" : "moveUp"});
}
function moveUp()
{
iTween.MoveBy(gameObject, {"z" : floatDistance, "easetype" : "easeInOutCubic", "time": floatTime, "oncomplete" : "moveDown"});
}
function fadeOut()
{
iTween.FadeTo(gameObject, {"amount" : 0, "time":1.5, "easetype" : "easeInOutCubic"});
}
Answer by JoeProgram · Jan 03, 2012 at 11:44 PM
I had an unexpected Null Reference Exception from iTween happen to me when the iTween script was mysteriously set on a GameObject in the inspector. Perhaps that happened to you too.
Answer by Mox.du · Nov 15, 2011 at 07:24 PM
Hi,
your script works without any errors.
Regards.
$$anonymous$$aybe there is an error in some other script that you might have.
Answer by rpmobile · Jan 13, 2012 at 09:18 PM
I had the exact same issue. It turns out, I was instantiating a GameObject twice. When I removed the 2nd one, no errors appeared in the Log.
Your answer
Follow this Question
Related Questions
iTween call producing NullReferenceException 3 Answers
Using iTween with a prefab tree. 0 Answers
iTween - Null Reference 0 Answers