Hello! i have line where i call clickedEvent, and it not working and gives an error: Error running Lua task: [A5C88492F19F2E34] MainUIScript:27: attempt to call a sol.sol::detail::unique_usertype<FScriptEvent> value (field 'clickedEvent')
I tryed call function UI.SetCanCursorInteractWithUI(true), but this isn't helped with this error.
Here's my script:
-- MainUIScript
-- By Hramzhuk
-- define variables
local mainUI = World.FindObjectByName("MainUI")
local mainMenuContainer = mainUI:FindChildByName("MainMenuContainer")
local gameOverMenuContainer = mainUI:FindChildByName("GameOverMenuContainer")
local playButton = mainMenuContainer:FindChildByName("PlayButton")
local backToMainMenuButton = gameOverMenuContainer:FindChildByName("BackToMainMenuButton")
print(playButton)
-- set all needed for player to enable him press buttons
UI.SetCursorVisible(true)
UI.SetCanCursorInteractWithUI(true)
-- define button functions
function playButtonClicked()
print("Button clicked!")
end
-- set button functions on certain events
playButton.clickedEvent(playButtonClicked)