Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class HeadFlight : MonoBehaviour
- {
- public float airSpeed;
- public float calibration;
- public Rigidbody plane;
- public Transform epty;
- public Vector3 fDirection = new Vector3(0, 0, 0);
- public float thrust = 1f;
- // Start is called before the first frame update
- void Start()
- {
- }
- void Update()
- {
- }
- // Update is called once per frame
- void FixedUpdate()
- {
- airSpeed = plane.velocity.x * 10000f;
- airSpeed = (Mathf.Round(airSpeed * 100f)) / 100.0f;
- if (Input.GetKey(KeyCode.E))
- {
- Debug.Log("E");
- plane.AddForce(fDirection.normalized * thrust, ForceMode.Force);
- //plane.AddForce(fDirection * thrust, ForceMode.Acceleration);
- //plane.AddForce(fDirection * thrust, ForceMode.Impulse);
- //plane.AddForce(fDirection * thrust, ForceMode.VelocityChange);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement