I have a simple bit of code where i check the position of my mouse and if it is not null, i snap the position to a particular place.
The problem is, i can't seem to pass the value to the method. The code looks like this:
Vector3? T = Mouse.WorldPosition;
if (T != null)
{
FindSnapPoint(ref T.Value); //property or indexer may not be passed
}
Why is this not allowed? And what can I do to fix this problem, i don't use a return since i use this method in a lot of places and it makes it a lot more elegant if i ref
the value.
Is my only option here to revert to returning a Vector3 rather than using ref
?