- Home /
Question by
RyanAtEvno · Sep 15, 2017 at 03:23 AM ·
c#rotationtransformmobile
GO will not rotate on swipe.
I have swipe from mobile set up through another script. Each respective swipe sets a bool true then resets. A right swipe sets swipeRight true etc. I set up a test audio clip on the function to make sure the input was being received and the audio plays every time I wipe left but I cant get the rotation on GO to work.Help =]
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class Rotate : MonoBehaviour {
public SwipePivot SwipePivot;
public AudioSource TestAudio;
// Update is called once per frame
void Update ()
{
if(SwipePivot.SwipeRight)
gameObject.transform.Rotate(new Vector3(0, -90, 0));
if (SwipePivot.SwipeLeft)
TestAudio.Play();
}
}
Comment