So I created this fan but its not spinning the way I want.
The script attached has the following running in it:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[DisallowMultipleComponent]
public class Motor : MonoBehaviour
{
[SerializeField] float speed = 2f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.Rotate(Vector3.right * speed * Time.deltaTime);
}
}
How do I make it stay in place and just spin?