Talk:DisablePlayerControls - InputEnableLayer

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

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. This will disable the player controls for ten seconds and then the layer will cease to exist when the function returns. Scrivener07 (talk) 2017-04-28T03:05:33 (EDT)
Event OnInit()
    InputEnableLayer myLayer = InputEnableLayer.Create()
    myLayer.DisablePlayerControls()
    Utility.Wait(10)
EndEvent