Your third person character as a NPC

Hi there

I’m trying to make my own 3rd person character as a NPC; I don’t want my character to have any controls, apart from choosing actions with a side menu; I want it to walk around, sit down etc, and when I choose the action from the menu, the AI stops whatever he’s doing and go to the path I chose from the menu

I edited the blueprints: added event, delay, walk on random location and all the stuff needed…

…But when I test it: the player doesn’t do anything and even the controls don’t work

Can anyone give me some pointers?

Hey @EisP4nzer ,
did you add a NavMesh inside your level?
And here are two videos about AI (one with BehaviourTree, one without):

hey…
Thanks for the reply

I managed to get it working partially, the NPC now “moves”, but it only slides with opened arms to a random location; I don’t know what I’ve done wrong but the walking animation is not kicking in; I tried everything on the blueprint but didn’t manage to get the NPC walking properly…

About the behaviour tree it simply works… I’ve watched several other videos on YouTube, but none of them even mentioned it

So many thanks

EDIT:
OK, so just as I was editing this to say I managed to walk (but still, he does not look forward while moving (I changed to animation asset); I’m going to read your comment know, thanks

For the walking animation you have to add some nodes:

Inside your animation blueprint called ABP_Manny, the one you select here (can be different)
image

you change this:

and inside your NPC character you change this:

This way your NPC will move. Maybe there is another solution to this, but this is the only one I can give you.

Hey

I’m still trying to get that in the blueprints, but I’m having some hard time finding two nodes:

  • The location (I guess) between branch and get velocity
  • The mesh reference to get anim instance

Can give some additional info on those two nodes? At least the name of them

Thanks in advance

EDIT:
the most similar I found, was "“transform location”, is this the one?

The first node is a != node, NOT EQUAL node.
image

The second node is a reference, the skeletal mesh from your character
image

OK

I’m going to show you what I’ve done so far:

Is this the right way?

My NPC is still walking sideways, he’s walking in a very weird way, like strafing, and when not moving he’s still walking but in place

thanks in adavnce

“Sorry, new users can only put one embedded media item in a post.”

Screenshot from 2022-09-28 17-56-25

First Image: NotEqual, you chose NotEqualExactly

Second Image: You have one input too much on your OR. This way it will always be true. Add the OR again with only 2 input pins.

Thanks, you’re the best

It works marvellous now, but now I have another question if you don’t mind

How do I delete my third person character, and move its camera so it follows the NPC?

And that would be all I need, at least for now LOL, but the rest would be on another post

And I must say this now, not just to you, but to anyone who might be reading this:

When I chose Unreal Engine 5, I read and watched a lot of reviews and comparisons, between Unity, Godot and UE, and I must say that one of the cons I read a lot, was that UE community, was not as strong as in Unity, and you just proved wrong everyone who have stated that, and for that, you have completely my gratitude, I can’t thank you enough

Well, what exactly do you want to do?

You can:
Create a new pawn with a SpringArm and a Camera and let this pawn follow your NPC
image


image
And choose this Pawn as your DefaultPawn in the WorldSettings/GameMode

OR
Create a Springarm with a Camera inside the NPC blueprint and do this in the level blueprint (NPC must be in the level to do it like this):


For this you have to choose None as your DefaultPawn in the WorldSettings/GameMode

“Well, what exactly do you want to do?”

I want my player to be that NPC; What I’m trying to do is an Android app that the player will not get any controls whatsoever, this NPC will only be like a “subtitle” for what the user he’s doing; Don’t want give any more details about it, bus basically, it will have some menus and “orders”, and that menu thing will be the main “attraction” of the app, this NPC will be like in the background or on the side of the screen

And depending what the user chooses from the menu, this NPC will follow doing what the player chose; That’s about it

EDIT:
Tomorrow I’ll go and try what you just posted

I’m glad to tell you this: it worked everything flawlessly… Thank you so much; I did the second option you gave me, now I just need to move the camera to a different position, but that I think I can manage for myself.

Thank you so much for all the efforts in helping the community.

1 Like