Bug with the „Use Persistence“ feature on a switch.

Please select what you are reporting on:

Creative

What Type of Bug are you experiencing?

Devices

Summary

The „Use Persistence“ function on a switch does not work for me.
When i auto save on the first round, and auto load on the second round, a device that should be activated, when the switch is turned on is not activated.

Steps to Reproduce

Place a switch device, and a item granter, the item granter should be enabled when the switch is turned on, and when turned off, the item granter should not be enabled. Then place a portal, when teleported the item granters should grant the given item. Then a timer device that stars on round start, with 15 seconds delay, on success teleport. Now activate the use persistence and the auto load and save feature on the switch. When you now turn on the switch the item granter should be enabled, then you are teleported after 15 seconds, and on teleport you should recive the selected items you put in the item granter. When you start the second round, the auto load function should automatically turn the switch on, now you should receive the selected items when teleported, but that’s not the case, it only works when I turn the switch off and on manually.

Expected Result

When auto loaded the switch state, on the second round, the item granters should be enabled. And any other devices.

Observed Result

The Item granters are not enabled, and other devices I tried, also did not were enabled.

Platform(s)

Windows, Ps5

Experiencing the same thing as well, Tried manually loading state for players for switches and it doesn’t make a difference. Also the load state event never fires.

[Edit] Well turns out I was being silly, The reason my conditional statements where failing where not because the of the switch device, in my case I was calling GetCurrentState into a Temp variable like if(PlayerButtonState := MySwitch.GetCurrentState[InPlayer])

Dropped the left half of the assignment, leaving if(MySwitch.GetCurrentState[InPlayer]):
and bam! It started working.

If anyone is having issues with this, and you are using Verse, check how you call the function!

Edit: Also switches are bugged in a few other ways too, for example in a live edit session you can clear persistence by calling a function passing the agent you want to reset; Doesn’t work in private versions or published :frowning:

1 Like

I was thinking, you should try to have something call the check state on the switch and bind the granter to the onwhenchecked. I think there is a checkbox in the settings you might have to enable that makes it so when the state is checked it will fire an event for on/off.

also thought of it, it unfortunatly did not work :confused:, but you could try that too, maybe it will work for you?