Move agent without navmesh using Locomotion Input

arenoo

Member
I need to move my agent mid-air where there is no baked navmesh so navmesh based movement is not an option. I want to make it go forward a little bit so I tried setting Locomotion.RawInputVector but the agent is not moving at all. Is this kind of movement intentionally disabled for navmesh agents? If so than how to enable it?
 
For this you should create a new ability and override the UpdatePosition method. You should also stop the NavMeshAgentMovement to prevent it from overriding the value.
 
I've ended up adding AgentHandler component to my agent and toggling the navmeshMovement ability on/off when I need to move it outside navmesh.
 
I am looking for a way to rotate the agent to look at a certain position without using navmesh. I don't want to create a separate ability for that because it seems a bit overkill for my case. I thought that the Locomotion.DesiredRotation was just what I needed but when I set it to my desired rotation in a FixedUpdate it just gets set back to 0 without applying any actual rotation. I tried disabling all the other abilities to make sure they do not override the values. Why is that happening? Are there any better ways to achieve what I want?
 
You will need to create a new ability for this use case. Abilities can be simple or complex so it's not overkill. You do need to set DesiredRotation, but not within FixedUpdate since that will be reset even if no abilities are active.
 
Okay, I've created an ability and it works fine only when the agent is grounded. I couldn't find any ability setting regarding it. I've noticed that the Aim ability is working in air so I've converted my ability into ItemAbility and it started working. However this is obviously wrong, could you help me here?
 
You can override CanStartAbility so it doesn't start when the character is grounded.
 
Ah, I see. It's likely an execution order issue. Item abilities execute after regular abilities. You can start by disabling the item abilities to determine which one it is and from there determine how to disable the movement.
 
Top