Pause button disables collision while active

Godot Version

4.5

Question

My game is a bullet hell game, and as such the player character needs to collide with bullets. The game uses the on_area_entered function to accomplish this.

The pause button works by just pausing the scene tree. Pretty simple. Every function in the game is paused except for the pause screen.

unless the player is playing as the specific player character who has the unique ability to not care. They set themself to the “always” process mode and processes as normal while the game is paused. They can stll fire bullets (although there’s a limiter to the amount of shots the player can fire while the game is paused for obvious balance and performance reasons). This works as intended.

However, pausing the game also seems to just disable the player’s collision. The code shouldn’t be blocked in any way, and I even put the hitbox’s process to “always” to make sure. My only guess is that the bullets (which still have their scene trees paused) aren’t responding to the player, so the player just assumes they aren’t colliding with bullets and goes on their merry way.

This makes a busted mechanic even more ludicrously overpowered, and obviously it’s a problem. The first thing that comes to mind is just having every single bullet also not actually pause and just put their main functions behind a check for if the game is paused, but that sounds annoying as hell. Is there a less stupid way to handle it that doesn’t involve redoing the player collision?

Instead of changing everything else, i would make it so that the character that ignores pause checks for bullets etc.

It would both be a lot easier to implement and not mess up all of your other scenes you would otherwise have to add weird exception states too

how would I do that
shouldn’t “on_area_entered” just do that anyway

Just ad an area to it that checks for other areas, and if other areas has a function called on_area_entered, you call area.on_area_entered(self). It would require you to have all the area entered functions namee the default thing or for you to check for all separate names you use.

if area.has_method(“_on_area_entered”):

area._on_area_entered(self)

okay, and how exactly am I supposed to check for other areas? get_overlapping_areas() doesn’t work either
I said “doesn’t involve redoing the player collision” for a reason

If you dont want to redo player collision you will have to jank out every other scene you want to collide with. Go for that option then.

i’d suggest you not playing with physics engine and instead make a helper functions that will handle everything while having main process and physics process

e.g

func _process(delta):
  for object in objects:
    object.update(delta) ## Your process logic goes here

func _physics_process(delta):
  for p_object in p_objects:
    p_object.p_update(delta) ## The same with physics logic

then if you have this scenario:

func _physics_process(delta):
  for character in characters:
    if paused:
      continue
    character.p_update(delta)
  for bullet in bullets:
    bullet.p_update(delta)

see you’ll have updates disabled without breaking physics engine, and if you want to unpause character you can just add if statement to it or smth that will check if character can move while paused

this way you can also have way more control over your game and save tons of time from fighting strange engine bugs