4
$\begingroup$

In the blender game engine, how do I make an animal change it's condition from walking to attacking when it sees the player?

$\endgroup$
  • $\begingroup$ It seems a standard enemy AI would work. What exactly do you want it to do? I might not be able to help, but it would help others to have some more information :-) $\endgroup$ – VRM Dec 30 '14 at 16:28
  • $\begingroup$ I want link to tutorial... $\endgroup$ – Adrians Netlis Dec 30 '14 at 16:29
  • $\begingroup$ Something like this? $\endgroup$ – VRM Dec 30 '14 at 16:31
  • 2
    $\begingroup$ Sorry man, tutorial requests are strictly off-topic. See how to ask $\endgroup$ – Scalia Dec 30 '14 at 16:33
  • $\begingroup$ As you see, NoviceInDisguise gave me 1 already. But I don't understand, why are htye off-topic and what exactly off-topic means in this site. $\endgroup$ – Adrians Netlis Dec 30 '14 at 16:51
2
$\begingroup$

You need to use states. Basically this will be :

Near property Player > And > State set state 2

It will look like this.

enter image description here

Now on state two, you need an Always sensor rigged up to a Steering acctuator with the player being the target object.

To avoid being stuck in state 2 forever, make something to switch back when the player isn't nearby anymore.

$\endgroup$
  • $\begingroup$ Yes, that is near with invert selected which switches back to state 1. Thanks, this thing works!:) $\endgroup$ – Adrians Netlis Dec 30 '14 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.