Eleron  1.0
 All Classes Namespaces Files Functions Variables Enumerations Enumerator
MouseLook Class Reference

MouseLook rotates the transform based on the mouse delta. More...

Inheritance diagram for MouseLook:

Public Types

enum  RotationAxes { RotationAxes.MouseXAndY = 0, RotationAxes.MouseX = 1, RotationAxes.MouseY = 2 }
 

Public Attributes

RotationAxes axes = RotationAxes.MouseXAndY
 
float sensitivityX = 1F
 
float sensitivityY = 1F
 
float minimumX = -360F
 
float maximumX = 360F
 
float minimumY = -90F
 
float maximumY = 90F
 

Detailed Description

MouseLook rotates the transform based on the mouse delta.

Minimum and Maximum values can be used to constrain the possible rotation To make an FPS style character:

  • Create a capsule.
  • Add the MouseLook script to the capsule. -> Set the mouse look to use LookX. (You want to only turn character but not tilt it)
  • Add FPSInputController script to the capsule -> A CharacterMotor and a CharacterController component will be automatically added. - Create a camera. Make the camera a child of the capsule. Reset it's transform.
  • Add a MouseLook script to the camera. -> Set the mouse look to use LookY. (You want the camera to tilt up and down like a head. The character already turns.)

Member Enumeration Documentation

Enumerator
MouseXAndY 
MouseX 
MouseY 

Member Data Documentation

RotationAxes MouseLook.axes = RotationAxes.MouseXAndY
float MouseLook.maximumX = 360F
float MouseLook.maximumY = 90F
float MouseLook.minimumX = -360F
float MouseLook.minimumY = -90F
float MouseLook.sensitivityX = 1F
float MouseLook.sensitivityY = 1F

The documentation for this class was generated from the following file: