How do you get AI to MoveTo target actor that is above ground, on another actor?

image


image
image

Hello may i get suggestions on how to tackle this problem. I have an AI character that I use AI MoveTo to get to a target actor and destroys the target actor when it gets to it. It is set to “Stop on Overlap” and it works fine when the item is on floor. When I play the item on the shelf the AI MoveTo stops working properly and just stands there, I think the actor still registers on the Nav mesh, cause the AI clearly moves to it but it never calls on success(which i need it to do to do my other code after the AI gets close enough to target actor.)

Does anyone have suggestions on how to implement a system when the target actor of AI MoveTo is above the nav mesh? Or how to deal with actors that are above the nav mesh? Possibly with something in the way like the shelf, not sure if the shelf’s collision matters much, but it might be completely covering the target actor? I dont know.

Thanks anyways if any advice or suggestions on how to deal with something like this.

Oh yeah also if he was right infront of the shelf on the other side, he still doesn’t stop trying to move to it even tho it’s within his acceptance radius.

Update: hmm the AI thinks the target actor is not a valid location now hmmm. Anyways maybe just give me any suggestion on how to tackle this problem thanks. Doesnt have to be anything I showed

Update2: ok after some playing around It appears that if I move the target actor lower(closer to the nav mesh), it will register with the nav mesh. I read if you move the target actor too far above the nav mesh, it might not work.

Here is new height and my AI gets to it and destroys it nice. Now to figure out how to be able to move the target actor higher on the nav mesh hmm

A quick suggestion would be to do a trace to find the floor, then use that location as the target for your AI.

Thats a good idea, I do have a little problem tho.
image
The shelves should block off the AI character from moving into it, right now I did a hacky solution by putting a collision box there with a tiny bit of space for the Item to go on the shelf. If i use a trace down, I’ll need there to be a nav mesh on the bottom, but if I put the shelf it destroys the nav mesh.

I’m thinking of some kind of hacky solution to try to find the closet Nav mesh floor, probably like 4 line traces around my item and hope it hits something. HmmmMMMmm

There should be a setting in your collision or any primitive component (static mesh, sphere collision, etc…) that specifies whether that component effects the nav mesh. This has the side-effect of have nav-mesh be generated underneath the shelves but a reasonable acceptable distance should counter that.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms