x


Space fighter banking

I've seen similar questions asked before, but they're all about making a fighter bank based on player input. I'm trying to make my enemy fighters bank. Here's what I've got so far:

    var relativePos = fightertarget.position - transform.position;
var fighterRotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation(relativePos), TurnRate * Time.deltaTime);

//banking on turns! Somehow!


transform.rotation = fighterRotation ;
transform.Translate(Vector3.forward *0.1);

Which is pretty much a basic homing script. I can't really get my head round Quaternions (yet) so it's kicking my backside. I've tried numerous different approaches, but nothing has worked so far.

more ▼

asked Jun 27 '12 at 12:21 PM

PiMuRho gravatar image

PiMuRho
18 2 4 6

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x181
x59
x7

asked: Jun 27 '12 at 12:21 PM

Seen: 320 times

Last Updated: Jun 27 '12 at 12:21 PM