mouse scroll to zoom unity c#
using UnityEngine;
using System.Collections;
public class zoom : MonoBehaviour {
private float zoomSpeed = 2.0f;
void Update () {
float scroll = Input.GetAxis("Mouse ScrollWheel");
transform.Translate(0, scroll * zoomSpeed, scroll * zoomSpeed, Space.World);
}
}
No comments:
Post a Comment