Can the physics engine be updated multiple times in a single frame?

Godot Version

Godot 4.4 dev 6

Question

Hello, good afternoon, I have a question, I am trying to create an object that when it is colliding with something goes up until it stops colliding (as quickly as possible so that the player only notices that it goes up in one frame), I have been doing it. Trying with a 3D area but I have run into the problem that in one it does not update in a frame causing the game to break. Is there any way to do it?

You can use ShapeCast3D with force_raycast_update() to force the collision update in the same frame:

2 Likes

do something like:
pseudo code

while(inside):
    new raycast
    if raycast.collision:  move up
    if no collision: inside = false

Thank you very much, I didn’t know about that function, it totally works for me!.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.