NPC: A How to

Hey Guys,

If I wanted to make an NPC where would I begin? Currently I have a Basic “Mob” Object that extends Node. In this Mob Object it has the Mesh for the Mob, Anim Channels, a CharacterControl, a Cylinder Collision shape, a Health Value, an Anim Control, a vector that represents where it spawned, a vector for walk direction. and a Node that represents the Target (if it has one). What else do I need in order to make a Zombie? I am a little new to jMonkey, but not to Java. So I am a bit frazzled on how to start with all this.



If I sound like an Idiot, i am sorry.

Can you explain a little what you mean by ‘what else’?



I’m really tempted to say ‘a lot of coding’. There, I said it :stuck_out_tongue:



I’d advise you to start small, then work your way up. First implement movements, then his movement towards the enemy…

Like what other controls do I need? Also for some reason When I made a Basic NPC, that just stands there, and doesn’t fall through the terrain, my player can walk through Him, and I have no Idea why.

Some basic AI would be a logical next step. Simply telling it to move towards the player (no animations, just straight object translation).

Add a control that updates the position of the NPC each frame making it get closer to the camera (player).

@acx234, Is the NPC a RigidBody, and the player a CharacterControl?

They are Both Character Controls

For a collision to work, if I’m not mistaken, it has to be between a CharacterControl and a RigidBody.