When i try to print the variable from another class, it prints the undeclared variable, so only 0.
Here is an example:
public class Player
{
Enemy enemy;
public void Initialize(){
enemy = new Enemy();
}
public void Update()
{
Console.WriteLine(enemy.Rectangle);
}
}
public class Enemy()
{
public Rectangle Rectangle;
public void Update()
{
Rectangle = new Rectangle((int)Position.X, (int)Position.Y, Texture.Width, Texture.Height);
}
}
I think the following code can help you
Main:
Result: