Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Rotator : MonoBehaviour
{
    public float speed;

    void FixedUpdate()
    {
        float input = Input.GetAxis("Horizontal");
        float currentRot = transform.rotation.z;
        currentRot += input * speed * Time.deltaTime;
        transform.rotation = Quaternion.Euler(0, 0, currentRot);
    }
}