Luke
Luke

Reputation: 55

Unity - scrollview/dragging breaks after specific scene inactivity

I have multiple scenes in my project which ill call A/B/C. A is the main scene where i have multiple UI functionalities some of which is point/click, others are a scrollview with a viewport all of which work as expected.

In scene B i have large sets of scenery as well as unitys third person movement controller to move the player around, this also works fine. Scene C is an appearance modifier to adjust the players aesthetics.

My problem is that if i enter scene B and switch to the game view (to simulate an android device loosing focus) then i return to scene A NONE of the scrollview or drag drop functionality works, its completely unresponsive. The event system is still correctly there with all of its associated scripts, the UI itself all looks to be fine and point click UI interactions are also fine just specifically anything that requires dragging.

If i repeat the test in any other scene the same problem doesn't occur, i thought it might be a timescale =0 setting that i was incorrectly applying, this isn't the case (I forced a timescale = 1 when returning to scene A just to be sure). Has anybody seen this kind of behavior before or could think where i could investigate? thanks.

before bug enter image description here

After bug has triggered enter image description here

one thing i noticed is that after the bug has triggered if i depress the mouse the UI element selected is cleared instantly (I took the screenshot whilst keeping the mouse pressed)

Unity version 2021.3.21

Upvotes: 2

Views: 66

Answers (1)

Luke
Luke

Reputation: 55

New Cursor.lockState = CursorLockMode.None;

something in the third person controller was setting the cursor lock in this scenario, this fixes it, hope it helps somebody.

Upvotes: 0

Related Questions