Enemies only move at lower than 60 FPS

Godot Version



I am trying to learn using this project (one of few c# ones):

The project is at 30fps. i would like to run this at 60fps.

I did this by setting the Engine.maxfps = 60 in the project.godot/editor

Now the enemies stop moving towards me.

here is the snippet responsible for moving the enemy:

Enemy extends RigidBody3D

    public override void _PhysicsProcess(double delta)

        var playerPos = _gameManager.Player.GlobalPosition;
        var direction = (playerPos - GlobalPosition).LimitLength();

        LinearVelocity = direction * MovementSpeed;

If i make the window a little bit larger the FPS drops ~52 and the enemies start moving.

I believe the logic is right, and not sure why this is happening.

I tried to print the double delta and it prints 0.01666666…

1 second / 60 fps = 0.0166666666666667 so that is correct. if your maxfps was 30 then delta would be around 1 / 30 = 0.0333333333333333

once you get used to gdscript, it is easy to migrate gdscript to c#.