Heres the Script:
var XPos : String = "X";
var ZPos : String = "Z";
var YPos : String = "Y";
function Update(){
transform.gameObject.position.x = XPos;
transform.gameObject.position.z = ZPos;
transform.gameObject.position.y = YPos;
}
function OnGUI(){
XPos = GUI.TextField (Rect (2, 22, 100, 20), XPos, 3);
ZPos = GUI.TextField (Rect (2, 44, 100, 20), ZPos, 3);
YPos = GUI.TextField (Rect (2, 66, 100, 20), YPos, 3);
}
And heres the error:
NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.SetProperty (System.Object target, System.String name, System.Object value)
Teleportation.Update () (at Assets/WorldBox/Scripts/Teleportation.js:6)
Line 6
it's a nullref because pragma strict was removed from the file, so js is being... "helpful" and assuming everything you type after a period is a legitimate member until runtime when it just gracelessly slams headfirst into nullref after nullref as it can't find these things /rant it's generally a good idea to leave
– Loius#pragma strictas the first line of the file.Ah, cool. I usually code in C#, so hadn't run into that before. Thanks.
– whebertill try this tommorow, in meantime is there a way I can combine my code and your example. I need this for the multiplayer part.
– DryTearOhh Boy, cant wait to try this out tomorrow - Excited :]
– DryTearHave you tried the code as a test?
– DryTear