x


How do I make animal AI

Howdy, I would like to possibly know how to make animals. I would like to model up a sheep or a cow or a chicken etc. and put them into my game as animals that walk around. I don't want them to do much, maybe just walk around. Nothing really else. I would also like to eventually be able to kill them with my axe I modeled today.

Right now the axe has one script and that is that when I mouse click it plays my swing animation I made. That's it and later on I would like to be able to kill them. I don't have an idea for this game, I'm just testing my skills.

Overview: Want to be able to have animals that don't do anything, just walking around, and relax. I also want to be able to kill them with both melee and firing weapons. I really only want to know how to make these guys just move around and sit there. I can do the killing thing later on because my world is kind of lonely. I'm using Blender btw.

more ▼

asked Jan 05 '13 at 12:51 AM

alexguy2552 gravatar image

alexguy2552
18 2 5 6

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

1 answer: sort voted first

you can look there http://unitygems.com/basic-ai-character/ the beginning shows how to give basics moves to a NPC. That can be applied to an animal. You could then add a running away condition when shot/axed at and get:

Vector3 dir = (player.position-transform.position).normalized * -1;

as a moving vector opposite the player position.

more ▼

answered Jan 05 '13 at 01:04 AM

fafase gravatar image

fafase
19.8k 18 27 68

(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:

x5705
x1263
x1034
x7
x2

asked: Jan 05 '13 at 12:51 AM

Seen: 2295 times

Last Updated: Jan 05 '13 at 01:04 AM