Inven tory Standard Input deprecated, how to set Enable Character Input on Gameplay Panle?

You can learn how we handle input by reading this page and it's child pages:

For the Gamplay Panel specifically, I think you will find the options you need on the DisplayPanelManagerHandler component which is usually located on the Canvas gameobject next to the DisplayPanelManager component
 
You can learn how we handle input by reading this page and it's child pages:

For the Gamplay Panel specifically, I think you will find the options you need on the DisplayPanelManagerHandler component which is usually located on the Canvas gameobject next to the DisplayPanelManager component
Thanks for your reply, I checked the DisplayPanelManagerHandler, but still no idea about disable user input when I open inventory panel, this is my settings:

1715397282050.png

Then, I read the document about input, I add a component like this:

1715397583076.png

It still not working for me, may be I was make a mistake?

I'm not understand: The way Input is disabled is by having all components that check for input listen to the “OnEnableGamePlayInput” event such that they can choose whether to enable or disable to input themselves.

Is it means I should add some event listener on character game object for disable input?

Thank you.
 
Sorry I was wrong it's on the DisplayPanelManager component:
1715584216471.png

Now if I understand correctly you want to enable/disable the input on your character.

If you are using the input system we provide with Opsive assets then you can use the IPlayerInput interface to check input. If you are using your own code to control input and you will need a way to know when UIS is trying to pause the input.
And you are right that's OnEnableGamePlayInput.

Here is an example:

Code:
protected IPlayerInput m_CharacterInput;

public IPlayerInput CharacterInput {
    get => m_CharacterInput;
    set => m_CharacterInput = value;
}

/// <summary>
/// Initialize all the properties.
/// </summary>
protected virtual void Awake()
{
    if (m_CharacterInput == null) {
    m_CharacterInput = GetComponent<IPlayerInput>();
    }

    EventHandler.RegisterEvent<bool>(gameObject, EventNames.c_CharacterGameObject_OnEnableGameplayInput_Bool, HandleEnableGameplayInput);
}

private void HandleEnableGameplayInput(bool enable)
{
    enabled = enable;
}


/// <summary>
/// Update tick.
/// </summary>
public void Update()
{
    var movementInput = new Vector3(CharacterInput.GetAxis(m_Character.HorizontalInput), 0, m_Character.CharacterInput.GetAxis(m_Character.VerticalInput));

    //Do stuff here.
}


NOTE: the parameter "gameobject" in the line:
EventHandler.RegisterEvent<bool>(gameObject, EventNames.c_CharacterGameObject_OnEnableGameplayInput_Bool, HandleEnableGameplayInput);
}

needs to the the same gameobject that the Input component is.
 
Sorry I was wrong it's on the DisplayPanelManager component:
View attachment 12640

Now if I understand correctly you want to enable/disable the input on your character.

If you are using the input system we provide with Opsive assets then you can use the IPlayerInput interface to check input. If you are using your own code to control input and you will need a way to know when UIS is trying to pause the input.
And you are right that's OnEnableGamePlayInput.

Here is an example:

Code:
protected IPlayerInput m_CharacterInput;

public IPlayerInput CharacterInput {
    get => m_CharacterInput;
    set => m_CharacterInput = value;
}

/// <summary>
/// Initialize all the properties.
/// </summary>
protected virtual void Awake()
{
    if (m_CharacterInput == null) {
    m_CharacterInput = GetComponent<IPlayerInput>();
    }

    EventHandler.RegisterEvent<bool>(gameObject, EventNames.c_CharacterGameObject_OnEnableGameplayInput_Bool, HandleEnableGameplayInput);
}

private void HandleEnableGameplayInput(bool enable)
{
    enabled = enable;
}


/// <summary>
/// Update tick.
/// </summary>
public void Update()
{
    var movementInput = new Vector3(CharacterInput.GetAxis(m_Character.HorizontalInput), 0, m_Character.CharacterInput.GetAxis(m_Character.VerticalInput));

    //Do stuff here.
}


NOTE: the parameter "gameobject" in the line:
EventHandler.RegisterEvent<bool>(gameObject, EventNames.c_CharacterGameObject_OnEnableGameplayInput_Bool, HandleEnableGameplayInput);
}

needs to the the same gameobject that the Input component is.
Hello, it works for me! Thanks!

But has another propblerms with me right now, that is I can not fire use mouse left button after I added gameplay panel.

It seems like the Gameplay panel prevents event propagation :).

1715602647426.png
 
Probably because of this component
1715671230345.png

Try click passthrough. If that does not work, remove that component. That should fix it for you
 
Top