Question by
BrodyDaChappy · Jul 03, 2016 at 07:04 PM ·
rotationrotatetouch controlstouchscreen
Rotate Player w/Touch Input Controls
Hi All,
I am using the below in my player controller script to try and rotate my player character when the Left or Right Touch Button is pressed, at the moment this is not working any help?
My player controls are attached to the GUI and use an Event Trigger to work, i did a similar thing for rotate and added the script below. .
public void RotateL(float rotate)
{
if (Input.touchCount > 0)
if(Input.GetTouch(0).phase == TouchPhase.Began)
transform.Rotate(0, 0, 100* -Time.deltaTime);
lbutton.jpg
(91.2 kB)
Comment
Is your project built for iOS/andrioid?
EDIT: Plus, make sure that your mobile input is enabled.