[BUG] Crosshair not returning to normal size if reloading is interrupted

Hello, I have a problem with the cross hair.

1. UTPS
2. 2019.4

The way to reproduce it:

1. Hide crosshair if the player is not aiming and only show it if they hold right mouse button
2. Add the Third Person Item Pullback ability
3. Shoot a couple of bullets and start reloading then immediately bump into a wall in the middle of the reload - don't let it finish.

The reload will be interrupted and next time you press the right click to aim you will see the cross hair hasnt returned to normal size and is still wide. It stays like that until you shoot and then it returns back to normal
 

Justin

Administrator
Staff member
Thanks for the report. Within CrosshairsMonitor.EnableCrosshairsImage you can add the following:

Code:
            if (!enable) { m_CurrentCrosshairsSpread = m_TargetCrosshairsSpread = 0; }
 
Thanks, I will try it out. Are you going to include it in the next version of the controller?

After adding that line of code at the top of EnableCrosshairsImage I still get the issue. Sometimes the cross hair is enabled if I hold down right mouse click and start reloading then bump into a wall, it just stays spread until I reload again or shoot. I think there should be a check if Reloading is cancelled return the cursor size to normal.
 
Last edited:

Justin

Administrator
Staff member
That code is in the released version. How are you disabling the crosshairs? Does EnableCrosshairsImage get called when it is disabled?
 
I have "Aim" state on the CrosshairsMonitor script that sits on the Canvas/Monitors/Crosshairs game object.

From there I set "visible" to true while Aiming and by default I have "Visible" = false in the inspector of CrosshairsMonitor.
 

Justin

Administrator
Staff member
Ah, ok. That will take a few more changes but I'll have this fixed in the next update.
 
Top