- Home /
Field 'UnityEngine.Vector3.transform' not found
I get a MissingFieldException for this line, even though I can even print the transform.position in the console:
uniqueRubberBand = Instantiate(rubberBand, transform.position, transform.rotation);
And yes the script is attached to a gameobject.
What is the type of rubberBand? GameObject? Or Transform?
Ah ... O$$anonymous$$ ... well this line is most definitely fine ...
Basically what the error is telling you is that somewhere you are using .transform on a variable of type Vector3, of which there is no such command. Thus, the compiler is generating a $$anonymous$$issing$$anonymous$$ethodException(). That's all I can tell you though ...
Thanks for saving us of reading 600 lines! Post just the relevant lines: where rubberBand and uniqueRubberBand are declared, for instance. Check also if the error is really in the line you've posted - this error looks very weird!
Answer by Luci85 · Apr 11, 2012 at 06:08 PM
Found the error! Had a typo in the prefab script which was attached to the rubberband.
Debug.Log(anchor.transform.position) //anchor:Vector3
So in retrospect the error message is right.