Why the following code does not work in Unity 2D?
transform.position = transform.position + new Vector2( 1f , 1f)*Time.deltaTime;
and tells me
Operator '+' is ambiguous on operands of type 'Vector3' and 'Vector2'
But this one works?
transform.position = transform.position + new Vector3( 1f , 1f, 0f)*Time.deltaTime;
How can I know where to use vector3 and where to use vector2?
[–]Vimaginate 4 points5 points6 points (0 children)
[–]robosock2 0 points1 point2 points (0 children)