I am working on a BGE Horror Game right now and I want the enemy to follow the player around, but not directly. I want it to also walk around radon parts of the map even when the player is not there. Is this any possible with the Steering Actuator? And also, I have seen the different behaviours that I can apply (Path following, Seek, Flee). What is the difference between these 3?

Thanks in advance!

  • $\begingroup$ Welcome to BSE! :D As far as following the player around, I think you'll have to do a bit of work in python for that. I would suggest having the enemy path find to an empty that is placed randomly via a python script. As far as the different behaviors go, from what I can remember path following has obstacle avoidance and is a good way to get from point A to point B. Seek will cause the object to just start walking towards the target, and flee will cause it to start walking away. I believe seek and flee have basic obstacle avoidance, but I'm not sure. $\endgroup$
    – Billy S
    Jun 26 '18 at 0:52

Possible result: enter image description here

What you're searching for is called a "Navmesh" and it is done without any python-code.

Therefore you need the Steering-Actuator.

The Seek-Mode makes your object to allways face into the direction of the target and move towards it, until the set distance is reached.

The Flee-Mode is quite the opposite, it makes your object move away from the target, until the set distance is reached.

What you need for avoiding obstacles is the Path following-Mode. This mode uses a mesh that tells your object, where it can move and calculates the fastest way to the target.

1. Create a Navmesh - select every collision objects in your scene, including the floor. Then click on Build Navigation Mesh, which creates you a plane with holes, where your obstacles are. Play around with the Agent-Values if your scene has ramps or different hights...

enter image description here

2. Use the Navmesh by choosing your Navmesh as "Navigation Mesh" in your Steering-Actuator.


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.