View Single Post
Mr Kidnapper
Senior Member
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 01-29-2012, 08:16 PM

You want to know how to make an NPC walk? I'll assume you made a walk animation. First things first: The thing you're trying to make is called an AI. Problem is, I don't know what you want to do with it. Well, what do you want to do with it?
Let's assume all you want to do is get the foo to walk in a random direction at random times.
Make three random numbers. One is between 0 and 10, the second is between -.5 and .5, and the third is between 0 and 20. The first one is how long a wait should be done between walks. -.5 and .5 denote which direction it should walk in and by how many degrees, up to 180 degrees left and 180 degrees right. 0 to 20 is how many meters it should walk.
Make an event that executes this method, and by that I mean every 0-10 seconds it makes an NPC turn -180 to 180 degrees and complete the walk animation while moving forward 0-20 meters.

If you want the NPC to chase the camera, you simply have to do the same thing, except make the NPC face the camera.
This is kinda cheap. At some point someone will figure out how to get the NPC to follow a path in order to reach you.
Reply With Quote