Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | raKdoS |
Example
func _on_body_entered(body: Node) → void:
set_physics_process(true)
func _on_body_exited(body: Node) → void:
set_physics_process(false)
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | raKdoS |
Example
func _on_body_entered(body: Node) → void:
set_physics_process(true)
func _on_body_exited(body: Node) → void:
set_physics_process(false)
Reply From: | kidscancode |
For what purpose? You should never make assumptions about optimization, you are most likely just wasting your time.
If you are having a performance issue, you must profile your code and identify exactly what is causing the problem. Without doing that, you’re just adding unnecessary code and doing nothing at all, or even possibly causing more problems down the line.
In short: don’t worry about it.