#Ball rolling ghosting

1 messages · Page 1 of 1 (latest)

patent osprey
#

I just made a quick ball rolling arena and this is the ball movement code:

extends RigidBody3D

var MOVEMENT_FORCE = 30

func _physics_process(delta: float) -> void:
    var input_dir = Input.get_vector("move_left", "move_right", "move_up", "move_down")
    var direction = Vector3(input_dir.x, 0, input_dir.y).normalized()

    if direction:
        apply_central_force(direction * MOVEMENT_FORCE)

the camera is just a phantom camera following and looking at the ball.
The recording looks like jittering, but the game actually looks more like ghosting.

patent osprey
#

ok, so if I limit fps to 60 this issue is gone. it's apparently related to the refresh rate of my macbook screen. the ball is still going through the wall if it's fast enough, but at least I see only one ball in the screen now 😅

vapid steppe
#

Could you try that on dev 6? I think that was solved.
For collision with thin walls, enable continuous_cd, it's more precise but slower.

patent osprey
#

I should’ve mentioned that this is dev 6

#

I will try continuous_cd 🙂

vapid steppe
#

Maybe it was unsolved Hmm
Can you upload a minimal reproduction?

patent osprey
#

sure, will do. github?

#

here it goes

vapid steppe
#

404 :)

patent osprey
#

oh, not public, let me fix that

#

fixed it

patent osprey
#

enabling continuous_cd on the ball rigid body does seem to fix the issue indeed

vapid steppe
#

Indeed, I can reproduce it and I'm not sure what's causing it

#

You can reproduce it on lower framerates by lowering the physic framerate

vapid steppe
#

Actually, it doesn't happen in a simple recreation I made. There must be a difference, can't find it

patent osprey
#

I'm happy to open an issue, although the problem is I'm not quite sure how to describe it. the going through wall problem seems to just optimization of the engine that by default checks the ball for collision only on the physics process calls without accounting for how much is the ball moving, something like this first scenario:

#

the problem of the jittering seems be related to refresh rate. if left uncapped, I can see the ball ghosting on the screen, although recording and screenshotting it doesn't get it, which is another evidence of refresh rate problems

#

which is what I did on this example