How to make a big AICharacter that can still use pathfinding?

Hello everyone,

I’m planing on making a game where you can encounter big and small NPC humanoids that can walk around and even attack the player.
As a proof of concept I tried making a giant version of the blue human in the 3rd person template. I wasn’t able to get it working because the giant character refuses to move.

So I came up with a simple set of steps that would reproduce the problem.

Steps to reproduce

  • Create a new top down template
  • Increase the size of the “CapsuleComponent” of the “MyCharacter” blueprint by 5 times
  • Increase the “Target Arm Length” of the “SpringArm1” component by 5 times
  • Remove all obstacles on the map except the floor and walls
  • Raise up the “PlayerStart” on the map. So that the character has room to spawn

This is the result:

23858-bigtemplatecharacter.png

When I try to move, the character just doesn’t respond, at all.

Reasoning:

I think that since the center of the character (center of the collision capsule) is too far off the ground then the path finding may think that the character is flying and so it fails to create a path.

Attempted Solutions

  • I tried increasing the “Agent Radius”, “Agent Height”, and “Agent Max Height” in the “RecastNavigationMesh” on the map by 5 times. But it didn’t work.

  • I tried increasing only the size of the character’s skeletal mesh and that did work (was able to do path finding). But it’s not a proper solution in my case because multiple giant AI characters will be overlapping each other.

  • Changing the character’s collision capsule to a cylinder would probably work because I can keep the center low by making the height of the cylinder very small and its radius enough to keep giant character from occupying the same space. However I’ve read that it’s not possible to change the collision component of a character.

  • Changing the center of the character’s collision capsule such that the center is on of floor (thus the character’s canter would also be on the floor). However I have no idea how to do so.

  • Making the character’s collision capsule very tiny (height:1, radius:1) and then adding another collision component to the character to prevent multiple characters from overlapping each other. However the second collision component gets completely ignored during gameplay.

  • I even tried (out of desperation and a possible state of insanity) to rotate the skeletal mesh 90 degrees along the world y axis (such that the mesh is lying down on the ground) and then rotated the entire character 90 back on the construction script (such that the mesh is right side up) during gameplay. At that point the height of the capsule increases along the x axis. Then I keep the radius of the capsule very small and increase its height such that it’s like a beam going front to back along the feet of the character. It’s very hard to describe so I provide a picture. However even though the center of the capsule at the point is near the ground, the character’s pathfinding still doesn’t work.

All you need to do is to extent default navigation query’s extent in NavigationSystem.SupportedAgents, especially in the Z axis (can be done via Project Settings). This has been already addressed for characters and should be working as expected in 4.7 without any need to expand querying extent, although for huge characters I’d recommend keeping it.

Cheers,

–mieszko

Thanks.
I increased the Default Query Extent in Z and it worked. The big blue guy was able to do path finding.