computer ai

Blitz3D Forums/Blitz3D Beginners Area/computer ai

I have tried using a cone as an invisible "sensor" and the problem is if the entity you are trying to detect resides entirely within the mesh of the sensor cone then meshesintersect() returns false because they are not intersecting.

One possible way around this is to define your own volume in front of your AI creature and manually work out if your player is within that volume.

another possible way is to detect collisions against the invisible mesh and use render tweening. this reduces the number of program cycles needed for each animation frame and will detect if your player collided with the mesh during the last cycle.

both of these combined with entityInView this will cope with obscuring objects such as walls, crates etc.

they still may not be the best ways of doing this :/