Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Control children with the Player Input component

Discussion in 'Input System' started by NPOCrushader, Nov 11, 2019.

  1. NPOCrushader

    NPOCrushader

    Joined:
    Oct 24, 2018
    Posts:
    5
    Hey!

    I am currently working on a character selection screen, where you press a button to spawn in the character selector (that has a player input component) and then press a button to spawn in the character associated with the selected player. But this is where I run into a few problems, I have tried two solutions.

    1. Having the character selection as a separate gameobject with a player input component. Here my problem is joining in the actual player manually, because when joining that character the Player Input manager is not able to assign an unique controller to the character so every controller can affect him with inputs.

    2. Having one gameobject that holds both the actual player and the character selection wheel as children of itself. However, here my problem is that I cannot make those children be affectected by the Player Input component on the parent.

    I would think that this is not the best way to do this, so if anyone have a suggestion on how to do this better or a solution to one of my above problems, that would be much appreciated!!