Talk:DisablePlayerControls - InputEnableLayer

Revision as of 03:02, 28 April 2017 by imported>Qazaaq

I had some trouble getting DisablePlayerControls - InputEnableLayer to work, and found out that the variable needs to be declared outside of a event/function bodies. At least that's what I had to do. For example:

Event OnInit()
InputEnableLayer myLayer = InputEnableLayer.Create()
myLayer.DisablePlayerControls()
EndEvent

Did not work. I had to do this:

InputEnableLayer myLayer
Event OnInit()
myLayer = InputEnableLayer.Create()
myLayer.DisablePlayerControls()
EndEvent

This might be how it should be done when calling any InputLayer based functions. --Lisselli (talk) 2017-04-28T02:16:03 (EDT)

It doesnt need to be declared in a function body. It just simply wont exist outside the function body if thats where you declared it.
Event OnInit()
InputEnableLayer myLayer = InputEnableLayer.Create()
myLayer.DisablePlayerControls()
Utility.Wait(10)
EndEvent
This will disable the player controls for ten seconds and then the layer will cease to exist when the function returns. ~~~~
Return to "DisablePlayerControls - InputEnableLayer" page.