VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
void AVR.Core.AVR_PlayerRig.Update ( )
inlineprotected

Definition at line 235 of file AVR_PlayerRig.cs.

235  {
236  if(characterController) {
237  // Set charactercontroller height based on camera height
238  characterController.height = Mathf.Clamp(AVR_PlayerRig.Instance.CameraHeightInRigSpace, AVR_Settings.get_float("/settings/core/charactercontroller/min_height"), AVR_Settings.get_float("/settings/core/charactercontroller/max_height"));
239 
240  // Set charactercontroller center to camera position in rig space. NOTE: This assumes that this.transform.pos is
241  // the same as rig.position. Eg. transform.localPosition = Vector3.zero.
242  Vector3 center = CameraInRigSpace;
243  center.y = characterController.skinWidth + (characterController.height * 0.5f);
244  characterController.center = center;
245  }
246  }
CharacterController characterController
CharacterController represeting the player. Null if no charactercontroller is present.
Vector3 CameraInRigSpace
Player camera in local space (relative to the AVR_PlayerRig object)