I have a F22 raptor with animated flaps, split of course. how do i script the animations rear elevate/ descend, turn and yaw
left and right?
do you have a starting code?
You could just rotate them?
i have no script to start with. im completly blind
this is my flight script but thats all i got.
:
/*Simple Airplane Control - Free Version
This version allow you control an object like an airplane.
To use it, attach this script to the object. Configure it as you want (I recommend
the pre-configured options)
Also attach a rigidbody to the object.
You have to configure some Axes. Read the README file.
*/
//Variables
var YawSpeed = 30.0;
var TurnSpeed = 30.0;
var ElevateSpeed = 30.0;
var Acceleration = 0.1;
var MaxSpeed = 40;
private var Speed = 0.0;
function Update(){
//Limit the speed
if(Speed >= MaxSpeed){Speed=MaxSpeed;}
//Apply gravity only if the speed is 1/3 of the MaxSpeed
if(Speed <= (MaxSpeed / 3)){
rigidbody.useGravity = true;
}else{rigidbody.useGravity = false;}
//Continuous movement
transform.Translate(Vector3.forward * Speed * Time.deltaTime);
//Acceleration Deceleration
if(Input.GetAxis(“Accelerate”)){Speed = Speed + Acceleration;}
if(Input.GetAxis(“Decelerate”)){Speed = Speed - Acceleration;}
//Yaw, turn elevate
transform.Rotate(0,Input.GetAxis(“Yaw”) * YawSpeed * Time.deltaTime,0);
transform.Rotate(0,0,Input.GetAxis(“Turn”) * TurnSpeed* Time.deltaTime);
transform.Rotate(Input.GetAxis(“Elevate”) * ElevateSpeed *2 * Time.deltaTime,0,0);
}