Quick question,
I have a simple kite going up and rotating as it goes up (to always face the handler). More, I use left and right arrows to change angle, so it can move left and right.
Here is my Update()
// Kite height
float currentHeight = transform.position.y;
// Kite angle fct of kite height
float kiteAngle = Mathf.Asin(currentHeight / lineLength) * Mathf.Rad2Deg;
// Move Left and Right
transform.Rotate(0, 0, 250 * Input.GetAxis("Horizontal") * Time.deltaTime);
if ( kiteAngle < 89 && transform.position.y < lineLength && transform.position.z > 0)
{
// Simulate Wind
transform.Translate(0, windSpeed, 0);
// Adjust kiteAngle
transform.eulerAngles = Vector3.left * kiteAngle;
}
But while my kite is entering the if clause, the “Move Left and Right” is not working. Any idea ?
It seems that I can’t transform eurlerAngles at the same time as Rotate, what is the clearest way to combine boths rotations ?
Sorry if that’s obvious, it’s my first script ![]()