novemberdev_first_person_shooter_godot icon indicating copy to clipboard operation
novemberdev_first_person_shooter_godot copied to clipboard

setting Engine.time_scale every frame causes framerate issues

Open MaxIsJoe opened this issue 4 years ago • 0 comments

Hey so I just discovered this while messing around the player script and I found out that setting the time scale to 1.0 every frame causes the game to lag on slower hardware.

a quick fix would be this :

else:
	if(Engine.time_scale < 1.0):
		Engine.time_scale = 1.0

this is just a small thing so if anyone ever used this tutorial as a template for their project or is using a toaster for godot like me, here's your solution.

also i recommend handling the time scale away from the player script, make it a function in a global singleton.

MaxIsJoe avatar Oct 14 '20 15:10 MaxIsJoe