hitBox = sprite.GetGlobalBounds();
Well thats how I assign it. Implicit assignment of a reference type always delivers a reference isn't it? Since it isnt a value type I don't need to add anything to make it explicit a ref.
Maybe I miss some core C# syntax here - can you point me to it? Because I feel like I did everything alright.
Hmm well...
Quering for GlobalBounds all the time makes me change my method to this:
public FloatRect GetHitBox()
{
return sprite.GetGlobalBounds();
}
Still the weird thingie here is:
[FloatRect] Left(-25) Top(-25) Width(50) Height(50)
thats the GlobalBounds Values for my player and the mob I spawned in the level. Both have the same values even tho they both are moving around.
What I'm missing here so badly?
EDIT: One solution might be that I calculate the hitbox Position by calculating it out (Position.x + hitbox.left...etc) But I don't think that's the best approach here.
greets Charlie