Age old FPShooter game prob. Raydars,addobjects, AI aim

(ineedanewbi) #1

ive been working on a FPS and 3rd person shooter for a long time now
ive run into a huge problem. i need my AI to aim up+down to the player.

dont suggest track to… its not what i want

i used two 90 degree raydars…AI’s line of sight and above…AI’s line of sight and below. when the AI sees the “player” in one of the raydars, it will look up or down

this worked amazingly well…i was so happy…UNTIL… i started using the ADD OBJECT ACTUATOR…as many know…blender runs very slow . i used add objects to add my AI characters…but after they are added…the RAYDAR SENSORS DONT WORK ANYMORE [email protected]#[email protected]%

can anyone fix this problem…i need raydar sensors to work after they are added in during the game

if ppl cant fix this problem…they can suggest another way of AI aiming up and down

u can see my game at

(gargola) #2

looks great! keep it up! :slight_smile:

(wiensta) #3

perhaps the radar needs to be on the added objects original layer?

add the radar system on the game layer and the add objs layer and see if it works.

(ineedanewbi) #4

i dont exactly understand what you are saying…

empties (which have raydar sensors) are parented to a AI character.
all of these are put on an UNACTIVE layer…the button is not pushed in

i dont know what u mean…can i put the empties on the ACTIVE layer??

should i duplicate objects??

(Pooba) #5

When you add your AI object, try adding other add object acuators that add the radar objects too.

Hope that helps,

(ineedanewbi) #6

i tryed that in a file…

i had a plane called “player”

i had an empty use the “add object actuator” to add another object with the raydar sensor

when the 1 object with the raydar sensor was added…it was suppost to detect the plane and the plane would turn

it didnt happen

it only worked when the object with the raydar sensor was on the active layer at the start of the game

thanks for trying to help

(Pooba) #7

Here’s another thing to try:

Instead of using add object, use replace mesh. duplicate the mesh and move it to another layer, then delete the original mesh’s vertices (all of them) and then use the near sensor with conjunction with the replace mesh instead of add object.

Does that work?


(ineedanewbi) #8

yea…i guesse that should work…

(saluk) #9

This problem plagued development of my fps. The demo I released (see post above) got around this by making terrain flat:)

How I solved it for later though, though it wasn’t perfect, was to use track to and have mesh-walls surrounding the ai unit where he wouldnt be able to shoot. Here is an example:


So the lines are the mesh walls, and the #'s are where he is able to shoot. When the track to is pointing at the wall, it’s ray wont see the player.

(ineedanewbi) #10

oh my god…i think ive found what i now think is acceptable

use a 3d track to on an empty parented to the AI

when the ray from the emty hits a mesh above the AIs line of sight, he will look up

when the ray from the empty his a mesh below the AI’s line of sight, he will look down

thanks for the help…

one last Question… is it possible to create a SOLID object?? like water…cuz mine is just a plane for the water level…it actually isnt 100% solid if you know what i mean… thanks