x


NPCs random movement

Hi,

I want to create a city with some NPCs walking around between the buildings.

How can I create a random movement for the NPCs?

Thanks

more ▼

asked Jan 08 '10 at 02:20 PM

maveryck21 gravatar image

maveryck21
239 29 32 45

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

You might want to look into pathfinding solutions. There are already a number of answers on this site which discuss various pathfinding implementations, such as this one:

AI Programming Resources

If you have more specific questions that are particular to your implementation, come back and ask!

more ▼

answered Jan 08 '10 at 02:30 PM

duck gravatar image

duck ♦♦
41.4k 95 152 415

(comments are locked)
10|3000 characters needed characters left

A simple approach would be:

  • Create either a waypoint network or a navmesh for your scene with Angry Ant's Path
  • Pick a random point to move to
  • Obtain a path to that point
  • Use UnitySteer's PathFollower to move to it, as described on this answer
more ▼

answered Jan 08 '10 at 04:24 PM

Ricardo gravatar image

Ricardo
5.2k 20 32 96

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x983
x48
x8

asked: Jan 08 '10 at 02:20 PM

Seen: 5052 times

Last Updated: Aug 27 '12 at 03:19 AM