custom actual working jitterfix
This commit is contained in:
@@ -13,7 +13,6 @@ config_version=5
|
|||||||
config/name="Godot Mono thirdperson controller"
|
config/name="Godot Mono thirdperson controller"
|
||||||
run/main_scene="res://scenes/main.tscn"
|
run/main_scene="res://scenes/main.tscn"
|
||||||
config/features=PackedStringArray("4.0", "Forward Plus")
|
config/features=PackedStringArray("4.0", "Forward Plus")
|
||||||
run/max_fps=60
|
|
||||||
boot_splash/show_image=false
|
boot_splash/show_image=false
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
|
||||||
|
@@ -3,11 +3,18 @@ using System;
|
|||||||
|
|
||||||
public partial class window : Node
|
public partial class window : Node
|
||||||
{
|
{
|
||||||
public override void _Ready()
|
public override async void _Ready()
|
||||||
{
|
{
|
||||||
ProjectSettings.SetSetting("physics/common/physics_ticks_per_second", Performance.GetMonitor(Performance.Monitor.TimeFps));
|
/* VSync should be used because needing to change the PhysicsTicksPerSecond in _Process takes CPU ussage
|
||||||
|
* You could also just set max FPS and delte this fix
|
||||||
|
*/
|
||||||
|
await ToSignal(GetTree().CreateTimer(2f), "timeout");//waits until the game has loaded some time
|
||||||
|
if (Engine.PhysicsTicksPerSecond != (int)Engine.GetFramesPerSecond())
|
||||||
|
{
|
||||||
|
Engine.PhysicsTicksPerSecond = (int)Engine.GetFramesPerSecond(); //PhysicsTicksPerSecond have to be the same value like current FPS or the movement will lagg
|
||||||
|
GD.Print("Set PhysicsTicksPerSecond to: " + Engine.PhysicsTicksPerSecond);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void _Process(double delta)
|
public override void _Process(double delta)
|
||||||
{
|
{
|
||||||
if (Input.IsActionJustPressed("fullscreen"))
|
if (Input.IsActionJustPressed("fullscreen"))
|
||||||
|
Reference in New Issue
Block a user