Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
9697ab1216 | |||
eee59dfa6a | |||
3c0c6ce9c0 | |||
61922a1b52 |
@@ -13,7 +13,6 @@ config_version=5
|
||||
config/name="Godot Mono thirdperson controller"
|
||||
run/main_scene="res://scenes/main.tscn"
|
||||
config/features=PackedStringArray("4.0", "Forward Plus")
|
||||
run/max_fps=144
|
||||
boot_splash/show_image=false
|
||||
config/icon="res://icon.png"
|
||||
|
||||
@@ -72,7 +71,6 @@ uncapture_mouse={
|
||||
|
||||
[physics]
|
||||
|
||||
common/physics_ticks_per_second=144
|
||||
3d/default_gravity=12.0
|
||||
|
||||
[rendering]
|
||||
|
@@ -3,11 +3,18 @@ using System;
|
||||
|
||||
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(1.5f), "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)
|
||||
{
|
||||
if (Input.IsActionJustPressed("fullscreen"))
|
||||
|
Reference in New Issue
Block a user