non player to rotate and move in direction

hi all. I need help. any help!

I’m trying to make some zombie type characters that I want to have the player dip in and out of control. either individually or as a group.

I’m quite basic on unreal skills and can’t seem to find any tutorials etc that does this (it almost seems to basic to cover).

i would like a zombie(or zombies) to be walking wherever it is facing forward. the player can set the zombie(s) rotation with a keypress (holding down will rotate till released) and the zombie will rotate and move wherever it is forward facing. a different keypress will make it stop and, another press will make it start again, moving simply in the direction it is facing. I’m not after mega smart ai, just something that can make the zombie start, stop, rotate and move whichever way it is facing. how do I do this?

additionally: what is the best approach for controlling multiple zombies individually? (eg reserve keyboard key ‘L’ for rotation and ‘K’ for start / stop for everyone, and have a way to pick ‘zombie 1’ only to receive commands, then ‘zombie 5’ etc?

any help is appreciated.

1 Like

is there a “standard player character” as well, or just these zombies (Squad commands, or RTS style)

“typically” in Unreal it is one controller to one Pawn AI, buuuut an AAIController is just an actor that is “controlling” one or more pawns, so what you can do is have an actor, or even a subsystem controller (to the best of my knowledge subsystems are still C++ exclusive), the pawns somehow register to the unified controller, and then commands are issued from that controller. AAIController is technically what is “needed” for easy quarries too NavigationSystem (navMesh)

for this unified controller (I will presume that you will have a unified AAIController) you would instantiate it manually, and then when the entities regiester to it, have the Controller hand the Pawns/Characters an ID (I prefer integers, but if you wanted to do String tags that is a little slower, but fine) and put the Entity into an Array.

with regards to sending the commands on keypress; if it just so happens that the PlayerCharacter, is the one that instantiates the given AAIController, then when the player uses one of those inputs like “L" or “K" then you just send/call the event on the AIController.

the select “Zombie 5” this one is actually not hard per say, but falls back to overall control style and and intent, for squad Commands style you would just need a way to cycle through the list, and give the commands specifically, where for RTS style you would have to deal with “selecting” the entity.

for tutorials you can try searching for “issuing Squad Commands” and for the RTS style it would be “RTS controller” (don’t be afraid to put Blueprints into the search if you are uncomfortable with C++) as a note these will be very different (part of that Game design is hard because every decision has 30 to 50 sub-chooses that must be made at the same time)

for requirements Unreal AI doesn’t “require” Blackboards, and BehaviorTree outright, they can make some implementations “easier” but they can also create unneeded duplication of data, and circular reasoning. It is possible to quarry NavigationSystem without a Controller at least in C++ you just need a bit more intent to do so especially for the callbacks on MoveComplete.

hi, thanks for responding.

your advice is still quite assumtively complicated for my brain I’m afraid!

whilst there wasn’t going to be a player character in use for this - there is no harm in there being a player character to channel these commands through (even if the player character is not visible / is static).

are you able to break it down into more detailed steps please? (the fact that you didn’t simply say “duhh it’s just this basic tutorial that’s everywhere” both validates my own hunt but also makes me feel this is more complicated than I thought!)

if there is no direct player character that exists, and you are giving commands directly to the Entities. you should probably be looking into an RTS controller.

you are probably thinking of your problem state is a far “too specific” (I want to do this specific thing, so if there is anything that will help it will be that specific thing), if that was the case then you should be looking to modify a template. If you need help with a mechanic they you should be looking for things that are similar, or looking for the conceptual pieces.

when it comes to tutorials and guides there are 2 flavors:

  • demonstrating a specific feature, with a little bit of expansion, but mostly just a vehicle to show off the feature.
  • mini-projects, which will take you through most of the steps to get to a specific target, and often just touching on each piece leaving it to the “student” to expand with variety
  • both of these types make their revenue from the guides (outside of memberships, and selling courses), by having their tutorials/guides to be as long as possible, while not showing you how to finish things, which if the viewer is not fully learning, and just following along. the viewer will just be dependent on the guide creator, which is only really benefitial to the guide creator as it keeps that viewer coming back.

both of these can be helpful for different reasons, and neither should be the totality of your project (especially if you intend to release your title). The best suggestions I can give regarding tutorials, and guides:

  • try to follow them until you understand what they are doing, and then try to apply it in some different way.
  • The other way as a test of your understanding is to let them explain what they are going to do in the guide, pause the video, try to figure out how you could do it, and then either when you are frustrated making no progress, or have gotten something working then watch the video to see how they do it, and compare.
  • ***if you only ever follow guides and tutorials exactly you might not actually be learning anything, unless you can apply it outside the tutorials and guides “holding your hand”. You are basically asking the other users of this forum and I to make you a tutorial/guide to follow for your idea***

Software engineering/development is problem solving at its core, and sometimes that means figuring out not just “how to solve the problem”, but “how can I break this down into smaller problems that are more easily solvable”



for how to Rotate and move an NPC entity, typically this is done with an AIController, but it can also be done in the Pawn itself. you can either modify the Transform directly, or you can talk to the MovementComponent for adding inputs thatway (rotation is only really supported out of the box in CharacterMovement, but is still doable with even FloatingPawnMovement)

for the matter at hand a “Player Character” is not absolutely required (in the project settings you can set the “DefaultPawn=none” and that is fine, it is only really highly suggested that there be a “Player Controller”, as a means to receive input from the player/user, but that is mostly for the purpose of being a “game” (a game with no input is a movie at the worst and a simulation at the best).

look for “Unreal Engine RTS Controller” (I have seen a couple floating around in both Blueprints and C++), if you are not making a true “RTS”, maybe you feel there are not that many entities, you are not going to have building, there are turns, or some other reason:

  • no physical player character
  • selecting individual or multiple Entities and issuing commands generally or granular, or directly or indirectly.

these are the basis for an RTS (if it shall be turn based then that could be your expansion point especially if it isn’t already in the tutorial/guide)

if you have a question about something more specific, particularly something not working as expected, or a specific concept that is not coming together, but “give me a tutorial/guide for my project” is probably better suited for google, youtube, or at last resort an LLM (the outline is probably more trustworthy then actual implementation because hallucinations)

1 Like

I’ll be honest, this is the most refreshing comment I’ve read from a forum in a long time.

all of your opinions ring true to me. I know some basics and only recently did I resort to AI and try to make it work for myself (with some limited positive results). I am frustrated that whilst unreal is expansive in its possibilities, it seems you have to ‘know it to know it’. and yes, tutorials rarely teach you why you have to tick x setting, just tell you to do it.

i guess I was hoping my question was basic enough that there were plenty of guidance out there, I just didn’t know how to ask for it. you have given me some good pointers. some currently cryptic, some good starters for 10. and I appreciate that.

It seems odd that I just want a npc to be able to just walk forward and I steer rotation of their forward trajectory, and it seems layers deep in learning (I would have thought it would be covered in some basics training agenda for newbies or something). but hey ho.

no doubt I’ll be back asking for some more clarification after I self quest for knowledge after your pointers. but for now, thank you