This script is attached to the plane propeller and the propeller start spinning smooth slowly to max speed.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spin : MonoBehaviour
{
public float RotationSpeed = 1;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.Rotate(0, 0, RotationSpeed, Space.Self);
if (RotationSpeed < 10)
{
RotationSpeed += 1f * Time.deltaTime;
}
}
}
I added empty gameobject with audio source component and a script that control the pitch of the audio source component.
what i want to do is to sync between the pitch value changes and the plane propeller speed changes.
now the plane propeller start spinning when i'm running the game and i want to use the pitch to make the sound like starting the plane engine from slowly to fast.
