Hello Guys,
so i am using this script to rotate a Spin sprite (here is the picture)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spin : MonoBehaviour {
public float smooth = 2.0F;
public float tiltAngle = 30.0F;
void Update() {
float tiltAroundZ = Input.GetAxis ("Horizontal") * tiltAngle;
float tiltAroundX = Input.GetAxis ("Vertical") * tiltAngle;
Quaternion target = Quaternion.Euler (tiltAroundX, 0, tiltAroundZ);
transform.rotation = Quaternion.Slerp (transform.rotation, target, Time.deltaTime * smooth);
}
}
But my problem is that i want the spin sprite to continue rotating while i am pressing on the left key, the same thing for the right key.
Any Help Guys !!
thanks