Question by
panoramabeats · Dec 20, 2016 at 07:16 AM ·
pauseresume
Best way to Pause/Resume an object rotation script?
I'd like to use the Space key and/or a UI button.
Here's the relevant parts of the 'Spin' script on the object:
using UnityEngine; using UnityEngine.UI; using System.Collections;
public class Spin : MonoBehaviour {
public float BPM = 10f;
// Update is called once per frame
void Update ()
{
transform.Rotate (Vector3.back, ( BPM / 240 * 360 * Time.deltaTime));
}
Comment
Your answer
Follow this Question
Related Questions
Pause scene when character hit object, then resume it from another scene 0 Answers
THE OCULUS GO RESUME AND PAUSE PROBLEM WITH UNITY 0 Answers
How to stop Background music from resetting when i resume game 0 Answers
When Resuming game after losing focus I just get a black screen? 0 Answers
how to Pause game if score exceeds a number and display text and button to resume. 2 Answers