Hi guys..
i just wanted to rotate may images in my game..
this is the script
public float rotationSpeed = 1.0f;
private Vector3 rotateSpeed;
void Start(){
}
void Update ()
{
if (Input.GetMouseButton (0))
{
rotateSpeed = new Vector3 (-Input.GetAxis ("Mouse X"), 0);
}
transform.Rotate (0.0f, rotateSpeed* rotationSpeed * Time.deltaTime, 0.0f);
}
my problem is when i started to click my mouse and drag it the rotation of my image
didnt stop..
i just wanted to minus the speed of image when its rotating.
can you give some example using my codes?
Second Question.
when the image is focus on the screen or trigger to the collider. the rotation will stop.
↧