[Bug] Moving during AimAssist target switch behavior breaks aim assist

dandesign

New member
Hi,

We're currently working on a puzzle game and have added some aim assist on the puzzle buttons to make it a bit easier for controller players. In case 2 buttons are close, we're also allowing the player to quickly switch between the buttons using the Aim Assist Handler script, which has a "can switch targets" bool.

However, it appears that the aim assist stops working when the player does anything during the aim assist target switch. So, for example, if the player is switching between two different buttons, and they move slightly during that point, the aim assist will no longer function. The same happens if they move the camera.


Hopefully this can be solved. Thanks!

EDIT: Forgot to mention this can be reproduced in the demo scene. Enable the Aim Assist Handler on the camera, set the break force to about .0025, and enter the "Aiming" room. Then switch the targets a bit, and when the switch is happening move a bit. The aim assist will no longer work until you exit play mode and enter again.
 
Last edited:
A break force of .0025 is extremely low. Have you tried increasing this value? Also, ensure your influence curve is at 1.
 
Higher break forces makes it a lot more "sticky", which isn't what we want. We don't exactly want to forcefully make the camera aim somewhere, just softly guide it to the button, so we need the break force to be very small. It's also worth mentioning that this bug can be reproduced with the default values.

The only thing that avoids this bug is setting the break force to something crazy, like 100, but that's obviously not a proper solution.
 
I will take a look at it for the next release. If you want to tackle it before I do take a look at ThirdPerson.Rotate and AimAssist.UpdateBreakForce. It is likely somewhere within these methods that there will need to be a change. If you do end up fixing it let me know and I'll take a look at it.
 
Okay, so after a bit of poking around, it seems that in that particular scenario the script gets stuck on m_SwitchingTargets = true, hence the aim assist no longer works.

To fix this, add m_SwitchingTargets = false; to here:

1571753221793.png

Everything works properly now. Thanks for the pointer!
 
Awesome. Glad that was an easy fix and thanks for sharing it. I'll include it in the next version.
 
Top