Movement stops when Aim ability started

Xefan

New member
Hi,

I'm programmatically controlling an AI UCC character, it moves around absolutely fine and abilities such as change height to crouch and change speed all work fine when toggled. When I enable the Aim item ability however with an assault rifle the character just stops in place and all movement input is ignored along with rotation - movement animation continues however.



I suspect I'm missing something obvious but has anyone got any suggestions as to why this might be as I've been trying to fix it for many hours and have looked through a ton of documentation but just can't find anything - I just want movement to continue normally even when Aim is activated rather than for the character to do movement animation on the spot but not actually move. I've tried replicating states as in the Demo scene and all sorts to no avail.

Thanks.
 
The Aim ability has the option of stopping the speed change ability but I'm not sure what would cause it to completely stop movement.. Have you tried creating a minimal scene with the aim ability active and moving the character?
 
I've tracked the problem down in code now, in TopDown.cs in UseIndependentLook(bool), the return statement checks:

m_PlayerInput.IsControllerConnected()

But m_PlayerInput is null, presumably because I'm trying to integrate Opsive components into my existing framework, and am not using Opsive's input code, hence I'm using this as an AI agent. This null reference exception is causing movement to fail even though the animator code has already run, hence why the animations were working but the movement isn't.

For what it's worth, I know my use case isn't necessarily typical - trying to use UCC in a modular manner consuming just the components I need rather than using the entire framework - but I've encountered quite a few null reference exceptions using it this way.
 
For AI agents you should use the combat or adventure movement types - these movement types do not check input.
 
Thanks Justin, I'll try that :) Does it matter which if I want my character to strafe and rotate? I know these movement types say they can't, but this constraint doesn't apply if rotate or strafe programmatically so presumably I won't run into any issues here?
 
Top