I’ve been working a very long tome on my flight simulator now. Its time to add some winds… I’ve tried it with that script:
public float Windspeed;
[Range(0, 360)]
public float Windheading;
Rigidbody rb;
public GameObject[] Player;
void Start()
{
Player = GameObject.FindGameObjectsWithTag("Player");
foreach (GameObject player in Player)
{
rb = player.GetComponent<Rigidbody>();
}
}
void FixedUpdate()
{
foreach (GameObject player in Player)
{
rb.AddForce(transform.forward * Windspeed);
}
transform.localEulerAngles = new Vector3(0, Windheading, 0);
}
the script works but it only affects the rigidbody, and not the wings. its like pushing the aircraft. (I mean that is was the script is doing…) but how can I add a wind which affects everything? so that even the wings generate lift?