Can't modify XNA Vector components
Posted
by Matt H
on Stack Overflow
See other posts from Stack Overflow
or by Matt H
Published on 2010-03-28T21:10:19Z
Indexed on
2010/03/28
21:13 UTC
Read the original article
Hit count: 174
I have a class called Sprite, and ballSprite is an instance of that class. Sprite has a Vector2 property called Position.
I'm trying to increment the Vector's X component like so:
ballSprite.Position.X++;
but it causes this error:
Cannot modify the return value of 'WindowsGame1.Sprite.Position' because it is not a variable
Is it not possible to set components like this? The tooltip for the X and Y fields says "Get or set ..." so I can't see why this isn't working.
© Stack Overflow or respective owner