Toggle Prop Visibility in UEFN
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
# A Verse-authored creative device that can be placed in a level
hello_world_device := class(creative_device):
@editable
MyProp :creative_prop = creative_prop{}
@editable
MyButton: button_device = button_device{}
var MeshVisibility : logic =true
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
# TODO: Replace this with your code
Print("Hello, world!")
MyButton.InteractedWithEvent.Subscribe(ToggleStatue)
ToggleStatue(MyAgent:agent) : void=
if (MeshVisibility?):
MyProp.Hide()
set MeshVisibility = false
else:
MyProp.Show()
set MeshVisibility = true