unity on mousewheel down
if (Input.GetAxis("Mouse ScrollWheel") > 0f) // forward
{
}
if (Input.GetAxis("Mouse ScrollWheel") < 0f) // backwards
{
}
unity on mousewheel down
if (Input.GetAxis("Mouse ScrollWheel") > 0f) // forward
{
}
if (Input.GetAxis("Mouse ScrollWheel") < 0f) // backwards
{
}
how to look around with mouse in unity
public class CameraController : MonoBehaviour //The script should be on the camera or on the player if it is a sphere
{
Vector2 rotation = Vector2.zero;
public float speed = 3; //the sensibility
void Update ()
{
rotation.y += Input.GetAxis("Mouse X");
rotation.x += -Input.GetAxis("Mouse Y");
transform.eulerAngles = (Vector2)rotation * speed;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us