Hello guys, today i am trying to make hand spinner game (screenshot) So i am using this script as a test to test the rotation : my question here is how i can get the speed from user without adding it as a variable inside the script. is there a function to call ? please help i am stuck
i want something really close to this game https://play.google.com/store/apps/details?id=com.smashlab.fidgetspinnersimulator
well first put the code in code snapet to read beter
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spin : MonoBehaviour {
public float speed = 10f;
public float Zaxis = 5f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey("up"))
RotateLeft();
}
void RotateLeft () {
transform.Rotate (0, 0, Zaxis * Time.deltaTime);
}
}