What does SetProcess affect

Godot Version

4.3

Question

Adding an Area2D named EndLevel that I’m going to use to finish the level.

Current code:

    public override void _Ready()
    {
        BodyEntered += CheckBody;
    }

    private void CheckBody(Node2D something)
    {
        if ( !(something is PlayerCharacter) )
        {
            return;
        }

        EndCurrentLevel();
    }

I have yet to define EndCurrentLevel(), simply because I want two things to happen when the Player reaches the end:

  1. The next level be loaded asynchronously and ChangeSceneToPacked into.

  2. Game logic to stop. I don’t want it so that the player can get hit even though they’ve reached the end.

Problems:

  1. How do I pause the game such that EndLevel and ResourceLoader still function?

  2. I want to use _Process() to do the whole ResourceLoader.LoadThreadedGetStatus() thing so that I don’t have to use timers or some other way. Can I trust SetProcess(false) to not mess the functionality up?

Note: I’m aware of GetTree().Paused’s existence, but I’m unsure about what it affects, hence why I’m asking.

will stop _Process(), but not _PhysicsProcess for that you have SetPhysicsProcess if you need.

Will it affect other functions of the object? Like checking for collisions, or ResourceLoading??

No. will not affect other methods.

1 Like