Basic Object Following Player - works in some of my game not in others... why? (same exact code)

Very new to Unreal, but making stead progress, but this one has me stumped.

Just want to make an object follow me. In project I’m working on… code does not work. Tested it in other projects… it works.

Tried a blank project, and just put this in to test the code on simple cube… cube will not move.

Cube sees me. It’s hitting the AI Move To… but cube doesn’t move. This exact code works in some unrelated projects… but not in the project I want it to work in (of course)… and so tried replicating in just a fresh project here… and it does not move. Baffled as to why?

Cube BP is a character… what am I missing.

THANK YOU TO ANYONE WHO CAN SOLVE THIS.

I’ve been pretty good at self-solving problems… but this one… cannot figure out. This is the first time I’ve posted here so please forgive any rules or proper form I may be missing. Thanks.

1 Like

Hi!

You probably missing NavMesh, which is AIMoveTo need to work properly.

Try and do the following:

  1. Add Nav Mesh Bounds Volume to the level

  2. Place it at the center of the level and scale it up, so it covers the ground that you want cube to move on

  3. Press P to reveal builded NavMesh to check and see if it is setted up correctly. There should be green flooring above the ground.
    If it’s not, then check if the ground is inside NaveMeshVolume

  4. Start the game and check if cube follows you.

Hope that helps!

1 Like

Thanks for the reply.

I did not have a NavMesh. I added that. Cube STILL does not move?

Same result as before. Cube sees me… it’s hitting the AI move… will not move.

Baffled.

Still messing around… I noticed if the ‘object’ that is to chase me is a skeletal mesh… it works.

(I deleted the static mesh cube, and put in a cube skeletal mesh) - and that works.

Although I am still wondering why it worked in some other previous projects (a third person shooter, and a FPS shooter) and in both of those, I just dropped in the cube, added code, and it worked. In the new project I’m using as an example above, won’t work unless I make it a skeletal mesh.

Same with the actual project I’m trying to get this to work in… apparently… I have to change the static mesh of the object into a skeletal mesh?

That works, but unsure if that’s the true ‘answer’ here.