0 votes

In my game a player has an “aura “ effect, meaning any areas or bodies nearby the player are affected by the aura’s respective effects.

However I don’t know how to make this clean and simple without being able to acquire the area(s) the aura collides with using script.

Some of these auras only emit their effect when certain conditions are made, for example: the aura only works if the enemy that is within the aura happens to have less than 25% health. So I need to be able to check what the aura is colliding with under physics process delta.

Simply using body entered and existed isn’t enough

in Engine by (58 points)

1 Answer

0 votes

Seems like you could create an Array to track the enemies that are currently in your Area node via the standard entered and exited signals. So, add an enemy to the array when it enters the Area and remove it from the array when it exits the Area.

With that, you could choose when/where to process the contents of the array, including in _physics_process if that's what you need.

by (19,316 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.