- Home /
Raise AI aim
I have AI similar to a turret set up that shoots as the player goes past. it works fine except that it shoots at the players feet.
shooterT.rotation = Quaternion.Slerp(shooterT.rotation, Quaternion.LookRotation(target.position - shooterT.position), rotationSpeed*Time.deltaTime);
I'm how do i raise it up a bit
Sorry if this is obvious, only new at this
Answer by The-Arc-Games · Sep 18, 2012 at 01:40 PM
Ideally, you create an emtpy gameobject that you parent to the target gameobject, and you position at the desired height. And then use that new empty gameobject as actual target!
This way, you can tweak it in the editor whenever you desire, instead of being forced to change the code.
Answer by apocriva · Sep 18, 2012 at 11:45 AM
Instead of target.position, try (target.position + target.up * SomeHeight), where SomeHeight matches the height of the point on the body you want to target.
Your answer
Follow this Question
Related Questions
Lock rotation of object 4 Answers
Make Clone AIs Stay Apart? 1 Answer
Enemy following the target with ITween 2 Answers
Change AI Follow Players 1 Answer
Enemy Follow Script Help 2 Answers