Tuesday, 15 September 2015

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(0scroll * zoomSpeedscroll * zoomSpeedSpace.World);
    }
}



No comments:

Post a Comment