Search Unity

Question UI Raycasts offset when screen splits for multiplayer, how would I correct this?

Discussion in 'Input System' started by SenthilFury, Sep 6, 2023.

  1. SenthilFury


    Feb 9, 2020

    I have been trying to figure this out for a while.

    I enter as player 1 on the keyboard and mouse. UI works fine.

    Player 2 enters on controller, the screen adjusts accordingly but now the raycasts for the player 1 UI is off. The UI itself remains in the center of the screen (did it so it avoids clippling when screen size changes).

    So buttons now don't work but if I click off to the left a bit out of the panel area it clicks. Not sure how to correct this. Please advise, as the bounds of the UI visually is OK but just when mouse buttons clicked it is thinking it is somewhere else.

    Not using a pointer for the controller so it works for any size of screen.