Godot Version
4.2 Mono
Question
I have a Boolean playerSeen that starts false. In the following code if i set the check to !playerSeen then the code runs however if i set it to playerSeen despite confirming the boolean is being changed none of the code ever runs as if the physics process refuses to read the new value…
public override void _PhysicsProcess(double delta)
{
velocity = Velocity;
if (!IsOnFloor())
velocity.Y += gravity * (float)delta;
if (playerSeen)
{
GD.Print("WORKING");
velocity.X = 30;
}
Velocity = velocity;
MoveAndSlide();
}