Hi there,
I have an empty array of Length 2 which I want to swap about the values. However, the following code, produces an error.
nodesPos = new Vector3[2];
nodesPos = new Vector3[exitNode.localPosition, introNode.localPosition];
Hi there,
I have an empty array of Length 2 which I want to swap about the values. However, the following code, produces an error.
nodesPos = new Vector3[2];
nodesPos = new Vector3[exitNode.localPosition, introNode.localPosition];
http://msdn.microsoft.com/en-us/library/aa288453(v=vs.71).aspx about halfway down the page
I think you want the following:
Vector3[] nodesPos = new Vector3[2];
nodesPos[0] = exitNode.localPosition;
nodesPos[1] = introNode.localPosition;
yes, I just ended up doing that.
Thanks
Since you clearly didn’t bother reading the article I linked and despite the fact that this isn’t a Unity-specific question
nodePos = new Vector3[2] { exitNode.localPosition, introNode.localPosition }