You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
I want to add a feature to my game where I slow down time in a given area, so any body that enters this area it becomes slower than the bodies outside this area. I wanted to be able to override physics time scale and idle time scale, individually for each node.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The feature is two overridable functions: _get_physics_time_scale and _get_idle_time_scale for any Node type. These functions return 1.0 by default, but you can override it to return any time scale. These time scales only impacts the individual node.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
In the start of the physics processing of a node (including internal), the engine would call _get_physics_time_scale, which stores the returned number in a cached variable internally (let's call it c_physics_time_scale). So whenever the function get_physics_process_delta_time is called, the returned value is multiplied by c_physics_time_scale, so there is no need to call _get_physics_time_scale everytime get_physics_process_delta_time is called.
The same would work for idle processing, but it would call _get_idle_time_scale and store it to c_idle_time_scale which is used in get_process_delta_time.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Nope, there is currently no way to change internal processing behaviour.
Is there a reason why this should be core and not an add-on in the asset library?
Because requires internal physics and idle processing behaviour change.
The text was updated successfully, but these errors were encountered:
What about internal processing? There is no way to work around with internal processing in gdscript. For physics server I'm not sure, but maybe passing the objects individual time scale before solving physics?
Describe the project you are working on
A fast-paced arcade game
Describe the problem or limitation you are having in your project
I want to add a feature to my game where I slow down time in a given area, so any body that enters this area it becomes slower than the bodies outside this area. I wanted to be able to override physics time scale and idle time scale, individually for each node.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The feature is two overridable functions:
_get_physics_time_scale
and_get_idle_time_scale
for anyNode
type. These functions return 1.0 by default, but you can override it to return any time scale. These time scales only impacts the individual node.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
In the start of the physics processing of a node (including internal), the engine would call
_get_physics_time_scale
, which stores the returned number in a cached variable internally (let's call itc_physics_time_scale
). So whenever the functionget_physics_process_delta_time
is called, the returned value is multiplied byc_physics_time_scale
, so there is no need to call_get_physics_time_scale
everytimeget_physics_process_delta_time
is called.The same would work for idle processing, but it would call
_get_idle_time_scale
and store it toc_idle_time_scale
which is used inget_process_delta_time
.If this enhancement will not be used often, can it be worked around with a few lines of script?
Nope, there is currently no way to change internal processing behaviour.
Is there a reason why this should be core and not an add-on in the asset library?
Because requires internal physics and idle processing behaviour change.
The text was updated successfully, but these errors were encountered: