✅ confused by this error
Cannot modify the return value of 'Player.Velocity' because it is not a variable
in the Input
method
all i am doing is modifying the field of the struct, why is that a problem?4 Replies
ok read, up on it, its because it is a copy
Velocity = new(0.0f, Velocity.Y);
is there a better syntax for this?Velocity = Velocity with { X = 0.0f }
maybe?ill keep that in my back pocket, thanks
And, yeah, that's because
Vector2
is a struct