- Home /
FPS Ai help
Hello, i'm working on a FPS mash up and i am having problems with making the AI's work.
The first Ai is a alien head, that is floating in the air (animation is all ready made) i need him to take damage and give damage to the "Player" The head will atack through the mouth (e.g. lasers comes out from his mouth)
I can get him to take damage but he will not attack back. I was wondering if you could help me with the script and show me what they should look like.
Thank you for your time. Have a nice day/night
Answer by TomPendergrass · Dec 30, 2012 at 09:35 PM
It's useful to outline all that your scripts have to do in order to achieve it's purpose. For an enemy retaliating to the player, it would have to:
A:) acquire the target (player.transform)
B:) Aim at the target with it's lazer mouth (There is a transform.LookAt() function)
C:) "I'm a firin' mah lazaaars!" It has to attack. I assume you know how to apply damage. Keep in mind you might want to program intervals for your enemy to attack. perhaps it shoots lasers every 5 seconds (yield WaitForSeconds(5)). Good luck!
The Script for taking damage is done and the dead replacement script, now i need to work on the the weapons firing script for the AI