Download

Moving object (AI)

Hello,

Ive tried to move a single object for several hours now, but without success. What I plan to do is having an object that spawns other smaller objects. These smaller objects should move to a special location on the map (prefereable some kind of invisible object / marker). What Ive tried to to is set up a blueprint class. There`s the first difficulty … what do I choose next, is the right class an Actor or a Character? If I click on Custom Classes I also can choose AI Controller, sounds pretty right for me. But is it?
Ok lets say I choose the AI Component and drag any prop into the components, why cant I just choose for example “Simple Move to Location” or “Move to Location” for my mesh?

As you see … it seems like I understood nothing yet -_- scratching head

This is the simplest way to perform movement:

  • Create empty project
  • Place ground with box brush
  • Place NavMeshBoundsVolume- you have to remember that this volume creates navmesh inside of it. This means that ground should be inside
  • Build -> Build paths
  • Press P, to show navmesh, if this works, then green field will be showed over your ground
  • Create new blueprint of character type (only this base class can use navigation)
  • Open new character and add some static mesh (chair is ready to use)
  • Open Graph->ConstructionScript tab and create nodes as in constructionscript.png
  • Open Graph->EventGraph tab and create nodes as in graph.png
  • Add new variable called TargetPoint of type Object->TargetPoint, set it’s as public (green eye icon)
  • Compile and save blueprint
  • Search for TargetPoint actor in Modes window, place one on navmesh
  • Select chair that is placed on your map, navigate to Defaults tab, find TargetPoint property and set it to target point actor on map
  • Simulate game, after 3 seconds chair will move to target point after 3 seconds :slight_smile:

Enjoy!

Hello mpo,

thanks :slight_smile: the chair is actually moving :). I might have some more questions regarding this topic, but right now I have something to test with. One thing I already noticed before is the capsule in blueprints components view. Can you tell me what this is for and how it works? Cause I cant move / scale / delete it. And as soon as I play / simulate the chair begins to hover. See pic attached.

AndroidFail_Forum_Post.jpg

That is the collision component. You can edit it’s height and radius down to 32. You can move your mesh down so it lines up with the bottom so it doesn’t hover.

Capsule component is the internal element of “Character” class. This means that if you create blueprint that has a “Character” parent, you will have it in your component’s tab. As it’s declared in c++ code, you can’t delete it scale, only resize. Capsule component is used to collide with ground - that’s why your chair don’t fall down to the kill Z.

MPO this is great info. If I could ask you 2 quick things, answer either at your leisure. How were you able to figure this out, it isn’t stated this straight forward in the manual right? Also more importantly, how would you approach moving a box with the arrow keys for example? I couldn’t get this really going, does this NavMesh volume have anything to do with it? Do I always need a volume of sort to control things?

Can anyone else provide some info? I feel like I’m at a dead end here.

Ok so I tried to replicate it using the standard blue mesh character and it is not working for me. My BotCharacter just stands there and does nothing. I’ve tried to replicate it both in level blueprint and character blueprint to no avail. I’ve attached the replicated blueprint. If someone can tell me what I’m doing wrong. If I play simulate my nodes always fire into failed.

I’ve followed all the steps above except *build -> build paths. I can’t find that function. Are you referring to navmesh?

I am using Parent Class: character so it should move. But even if I set up a simple move to actor function (to move to my controller) it still just stands. I’ve followed 3 different tutorials to make an AI walk and in each case the only difference I make is that I replace the object with the blue guy. In each case it just stand there and I’m having difficulty figuring out what’s the problem.

My hope is to make an AI that wonders randomly in designated area. But before that, I’m attempting to make it move in pre-designated target points to no avail. Any help would be appreciated.

@malospam, I’m completely new to this so its my best guess, but people who have a bit more knowledge in this usually can figure out stuff faster because they either used kismet which had similar functionality, they know C++ and are familiar with coding language, and/or they go study examples provided with UE4. From there-on its playing around and testing stuff.