using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AirplaneController : MonoBehaviour {
public float FlySpeed = 5;
public float YawAmount = 120;
private float Yaw;
// Update is called once per frame
void Update() {
// move forward
transform.position += transform.forward * FlySpeed * Time.deltaTime;
// inputs
float horizontalInput = Input.GetAxis("Horizontal");
float verticalInput = Input.GetAxis("Vertical");
// yaw, pitch, roll
Yaw += horizontalInput * YawAmount * Time.deltaTime;
float pitch = Mathf.Lerp(0, 35, Mathf.Abs(verticalInput)) * Mathf.Sign(verticalInput);
float roll = Mathf.Lerp(0, 35, Mathf.Abs(horizontalInput)) * -Mathf.Sign(horizontalInput);
// apply rotation
transform.localRotation = Quaternion.Euler(Vector3.up * Yaw + Vector3.right * pitch + Vector3.forward * roll);
}
}
It looks to me like you are moving the transform, and, in an update function. I could be wrong, but it seems that isnt going to consider the collision.
You will want to look into moving a rigidbody, or character controller, and also, using fixed update for most of the management, other than input.
Use CODE tags when displaying code please.