I am trying to get the position of a gameObject. but I get this error
The type 'UnityEngine.Vector3' does not have a visible constructor that matches the argument list '(UnityEngine.Vector3)'.
It doesn’t make much sense…
Thanks,
-Mike
I am trying to get the position of a gameObject. but I get this error
The type 'UnityEngine.Vector3' does not have a visible constructor that matches the argument list '(UnityEngine.Vector3)'.
It doesn’t make much sense…
Thanks,
-Mike
Impossible to say unless you post your code.
–Eric
very true
var GameObject1 : GameObject;
//this is the current method
Spawn.Push(Vector3(-3.139642, 0.54, -5.212473));
//this is the desired method
Spawn.Push(GameObject1.transform.position);
There’s nothing wrong with that code.
–Eric
Are you sure the error message is for that line of code? The console window will usually give you more information about the error, including the line number.
You are right that nothing is wrong with that code. What I had in my game was Spawn.Push(Vector3(GameObject1.transform.position));
It’s fixed now.
Thanks,
-Mike