Moving Pawn Actor to Target Actor

Hi,

I have created a Static Mesh Pawn Actor with Sphere shape and trying to move it to a target Actor which is another static Mesh with Cube shape(not a Pawn).

I used AI Move To in Blueprint class and have set Pawn and Target Actor, but the expected movement is not happening. What could be wrong.

Please help.

Thanks.

I think this issue is caused by “Cube of World” variable in PlayB Blueprint is not set with Cube Object reference. How do we create object reference of an Actor during Event BeginPlay.

If there’s only one Cube object in the world, you can just use “Get Actor of Class”.

Instance Editable already selected
Now I have selected cube in details panel.

What is a Nav Mesh, I don’t have it in my level. Would you please help with an example or doc link.

Thank you.

I did this. But it shows not compatible message when connecting to Set Variable. PFA screen.

And I have two cubes: one is blueprint class by name CubeOfWorld and another is regular static mesh without blueprint.

Now I removed the second cube and only one cube remains.

Set your variable cube of world to instance editable (is is right below the variable type in its details) and then go select the version of your sphere in the level. Then, in the details panel of the sphere, you can use the eye dropper to select the cube.

Also, make sure your sphere is set to use an AI controller rather than a player controller and that you have a nav mesh in the level.

Go back to your main viewport. In toolbar modes option, make sure “select” is checked. This should give you a “place actors” tab in the upper left.

In the place actors tab, click on the search and type in “nav.” One of the options should be a nav mesh bounds volume. Drag that into your scene and adjust it to make sure it covers all the areas you could want to move (including around both the moving actor and the target actor).

EDIT: Looking at your screenshot again, I’m not actually sure if this works with floating pawn movement type, but you can try it anyway. :slight_smile:

Yay!! that worked. adding Nav mesh bound volume resolved the problem.
Thanks a lot. I will refer Unreal docs to understand what is the use of Nav mesh thing!

Glad to help!

And, apparently, it does even work on non-character type actors. Good to know.