using UnityEngine;
using System.Collections;
public class NeedleRotateAround : MonoBehaviour {
public Transform gun;
public Transform pivot;
float prevAngle;
void Start ()
{
prevAngle = gun.transform.rotation.eulerAngles.z;
}
void Update ()
{
float currentAngle = gun.transform.rotation.eulerAngles.z;
float deltaAngle = currentAngle - prevAngle;
if(deltaAngle != 0)
transform.RotateAround(pivot.position, Vector3.forward, deltaAngle);
prevAngle = currentAngle;
}
}
after typed those, console show me two errors.
- Keyword `void’ cannot be used in this context
- Unexpected symbol
(', expecting
)‘,,',
;’,[', or
=’
it said these happened on line 16. why is this happened?