Issue with navigation to actor with big static mesh

So I’m making an RTS type of game and I want a unit (pawn class) move next to a building (actor class) and attack it.

I’m using blueprint node “Move To Location Or Actor” (i turned off “require navigatable end” and check use pathing) - i set building actor as a goal, but every time unit moves to a building it ends up walking around building and stopping in some random place around it not even facing the building.

So I figured out (by trial and error) that the issue is buildings mesh and it’s collision settings - it seems that unit tries to reach center location of building actor and building’s big mesh obstructs path to it. I tried adjusting acceptance radius but it does not work great, becouse when unit starts moving towards building it goes to some imaginary point behind it that probably is the closest navigatable spot to building’s center.

How could I make it work properly? I’ve googled a lot about this topic, right now I debating on adding some target points around building that will be spots for units to go to, but I wonder if there’s some easier method, something that I missed that might help me here.

Move to Actor sets the destination to the origin point of the mesh. Now if you create a BP and have the mesh as a component, then the destination will be the position of the root component (typically a scene component). Just offset the mesh relative position to the scene relative (0,0,0).

  • scene (root)
  • mesh

Other option is to use target points as you mentioned, but I would use them in a BP Actor class.

  • Scene (root)
  • Mesh
  • Target point
1 Like

you can sort of procedurally do it

Get Building Location, and offset it by direction to unit * bounds. Project that point to the nav mesh and you’ll have a rough closest Building edge

1 Like

Thx for suggestions and in-depth knowledge, i’m gonna try to apply what You said this weekend.

Thanks, I used this as my solution and it seems it works perfectly!

1 Like