Turning VSync On

Hi, so I have an issue with the game that I’ve packaged and tried on the PC’s at my Uni, I’m getting a lot of frame tearing on them. After a little looking, I’ve found some helpful posts here and there about this but none that actually work, I think the code may vary from version to version of UE4 perhaps? for the record this is on 4.11.2

I was wondering how can I turn on VSync to stop this? preferable as a command line to type into the running game because I have a packaged version on the computers already. If not how can I turn it on in the editor and then repackage to have it on??

Thanks,

1 Like

Hi ,

You can do this a couple of ways:

Require repackaging:

  • You can repackage the game with a command run in the game level for r.vsync 1. Use the Execute Console Command node.
  • You can set the r.Vsync=1 console variable in the DefaultEngine.ini file IIRC under the rendering section.

Already Packaged Game:

I hope this helps.

Tim

2 Likes

You can use the SetVSyncEnabled node instead of the console command:

You need to pass it the Game User Settings, you can obtain that using GetGameUserSettings:

To actually make the change you need to call ApplySettings:

So you would write: GetGameUserSettings → SetVSyncEnabled → ApplySettings

3 Likes

It seems like the r.Vsync console variable is no longer in DefaultEngine.ini.

1 Like

You can still add it to the .ini file in the rendering section. I tested this and it works!

2 Likes