In my GhostScript I have:
public class GhostScript
{
protected Timer patrolTimer;
public override void _Ready()
{
patrolTimer = GetNode<Timer>("PatrolTimer");
}
}
And then in my BlueGhost script I have:
public class BlueGhostScript : GhostScript
{
public BlueGhostScript()
{
patrolTimer.Paused = true;
}
}
Why does this result in "Object reference not set to an instance of object error?"
If I replace it with GetNode<Timer>("PatrolTimer").Paused = true;, it does work, but why does patrolTimer.Paused = true not work? I already got the reference to the node in the GhostScript didn't I?