New infront of Vector2?

Hi just curious as to why we must put the new infront of the vector2?

Hello @MAPLE_MOOSE,

In this scenario you are creating an instance of the Vector2 class.

The new operator is used to call it’s public Vector2(float x, float y); constructor.


See also;

Privacy & Terms