Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: acornbringer on November 28, 2023, 04:57:10 PM

Title: [SOLVED] Set VSync Count Action Having Trouble
Post by: acornbringer on November 28, 2023, 04:57:10 PM
I'd like to give the player the option to enable VSync in my game so I've plugged the SetVSyncCount (https://github.com/PlayMakerEcosystem/PlayMakerCustomActions_U2018/blob/master/Assets/PlayMaker%20Custom%20Actions/QualitySettings/SetVSyncCount.cs) action into my options menu but whenever the action is used, I get an error that reads "Value must be in between 0 and 4."

Code: [Select]
Value must be in between 0 and 4
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.Actions.SetVSyncCount:OnEnter() (at Assets/PlayMaker Custom Actions/Application/SetVSyncCount.cs:29)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2695)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2642)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2570)
HutongGames.PlayMaker.Fsm:DoTransition(FsmTransition, Boolean) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2609)
HutongGames.PlayMaker.Fsm:ProcessEvent(FsmEvent, FsmEventData) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2212)
HutongGames.PlayMaker.Fsm:Event(FsmEventTarget, FsmEvent) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2303)
HutongGames.PlayMaker.Fsm:Event(FsmEvent) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2384)
HutongGames.PlayMaker.Fsm:Event(String) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2371)
PlayMakerFSM:SendEvent(String) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:679)
UnityEngine.EventSystems.EventSystem:Update()

I'm only ever setting integer values between 0 and 4 in the actions variable so I'm not quite sure what could be going wrong. I had a look through some other posts here on the forums and while a couple people reported the same issue, a solution to the error was never discovered. Is there maybe an alternative to changing the vsync count during gameplay?

Any help would be appreciated!

Windows 10
Unity 5.6.4f1
Playmaker 1.8.9.f1
Title: Re: Set VSync Count Action Having Trouble
Post by: acornbringer on November 28, 2023, 05:25:11 PM
I figured I would try and remove the error condition from the script to see what would happen. As expected, no more error and I checked the scene view stats and can confirm that the action was working all along. I cant be sure why the error was called but maybe it has something to do with my different software versions.

I'm not savvy enough to make any suggestions but maybe there's an update that could be made to the if statement in this script that prints the error so that it can accurately detect problematic variables.