How can we add Vector3
as default parameter for a method? for example:
Void SpawnCube(Vector3 p = new Vector3(0,0,0)){...}
I just tried the line about I got an error:
Expression being assigned to optional parameter `p' must be a constant or default value
I want to customise a function to spawn some game objects
that if I did not provide the transform.position
, it will go to (0,0,0)
.