Is there a clean way to have consistent physics with any visual framerate?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Console

I am fairly new to Godot, but I understand that using _process(delta) will run the code every frame, while _physics_process(delta) will run the code inside at a fixed rate. Looking at that, it seems fairly simple that using physics_process would be a good choice for dealing with physics and such. However, if I leave the Physics Fps at default, all the code running inside of it looks like it’s running at 60fps, which does make sense I guess. I’ve changed it to 144 and it looks very smooth, but could that mess things up for those with less powerful computers? I’d like my game to have consistent physics, and I know that it still technically runs at a higher framerate than the physics process, but I also would really like for the game to be able to visually run at whatever refresh rate the player has, whether it be 60, 90, 144, 240, etc. I’m very sorry if this is a dumb or convoluted question, but is there any way to have a game look as smooth as the refresh rate of the monitor (so long as the PC has the power to drive it that fast) while having consistent physics between different framerates and refresh rates?
If not, would putting the physics Fps at a very high number (e.g ~240) cause issues if a PC were to not be able to get that many FPS?

Thank you so much in advance!

:bust_in_silhouette: Reply From: Merlin1846
extends KinematicBody2D

var velocity:Vector2
var speed:float = 60

func _physics_proccess(delta):
    velocity.x = speed*delta
    move_and_slide(velocity)

By multiplying speed by delta you are multiplying it by the amount of time between frames, doing this will make the object move at the same speed no matter the frame rate while you will still be able to change its speed through code.