private void Start() { groundCheckRadius = capsuleCollider.radius; rotationX = new SmoothRotation(zero); rotationY = new SmoothRotation(zero); velocityX = new SmoothVelocity(); velocityZ = new SmoothVelocity(); Cursor.visible = hided; Cursor.lockState = CursorLockMode.Locked; }
// Start is called before the first frame update void Start() { _collider = GetComponent <CapsuleCollider>(); _rigidbody = GetComponent <Rigidbody>(); arm = AssignCharactersCamera(); _rotation_X = new SmoothRotation(Input.GetAxisRaw("Mouse X") * mouseSensitivity); _rotation_Y = new SmoothRotation(Input.GetAxisRaw("Mouse Y") * mouseSensitivity); _velocity_X = new SmoothVelocity(); _velocity_Z = new SmoothVelocity(); Cursor.lockState = CursorLockMode.Locked; ValidateRotationRestriction(); //transform.rotation = transform.rotation * Quaternion.Euler(0, 30, 0); }
// Start is called before the first frame update void Start() { _rigidbody = GetComponent <Rigidbody>(); _rigidbody.constraints = RigidbodyConstraints.FreezeRotation; _collider = GetComponent <CapsuleCollider>(); _audioSource = GetComponent <AudioSource>(); _audioSource.clip = walkingSound; _audioSource.loop = true; _rotationX = new SmoothRotation(RotationXRaw); _rotationY = new SmoothRotation(RotationYRaw); _velocityX = new SmoothVelocity(); _velocityZ = new SmoothVelocity(); Cursor.lockState = CursorLockMode.Locked; //ValidateRotationRestriction(); }
/// Initializes the FpsController on start. private void Start() { joyStick = GetComponentInChildren <JoyStick>(); _rigidbody = GetComponent <Rigidbody>(); _rigidbody.constraints = RigidbodyConstraints.FreezeRotation; _collider = GetComponent <CapsuleCollider>(); _audioSource = GetComponent <AudioSource>(); arms = AssignCharactersCamera(); _audioSource.clip = walkingSound; _audioSource.loop = true; _rotationX = new SmoothRotation(RotationXRaw); _rotationY = new SmoothRotation(RotationYRaw); _velocityX = new SmoothVelocity(); _velocityZ = new SmoothVelocity(); Cursor.lockState = CursorLockMode.Locked; ValidateRotationRestriction(); }
/// Initializes the FpsController on start. private void Start() { FlashLight = GameObject.Find("FlashLight"); _rigidbody = GetComponent <Rigidbody>(); _rigidbody.constraints = RigidbodyConstraints.FreezeRotation; _collider = GetComponent <CapsuleCollider>(); _audioSource = GetComponent <AudioSource>(); arms = AssignCharactersCamera(); _audioSource.clip = walkingSound; _audioSource.loop = true; _rotationX = new SmoothRotation(RotationXRaw); _rotationY = new SmoothRotation(RotationYRaw); _velocityX = new SmoothVelocity(); _velocityZ = new SmoothVelocity(); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; ValidateRotationRestriction(); }
/// Initializes the FpsController on start. private void Start() { standColliderSettings = new CrouchColliderSettings(capsuleCollider.height, capsuleCollider.center); //localArmsPosStand = crouchHolder.localPosition; _rigidbody = GetComponent <Rigidbody>(); _rigidbody.constraints = RigidbodyConstraints.FreezeRotation; _collider = GetComponent <CapsuleCollider>(); _audioSource = GetComponent <AudioSource>(); arms = AssignCharactersCamera(); _audioSource.clip = walkingSound; _audioSource.loop = true; _rotationX = new SmoothRotation(RotationXRaw); _rotationY = new SmoothRotation(RotationYRaw); _velocityX = new SmoothVelocity(); _velocityZ = new SmoothVelocity(); Cursor.lockState = CursorLockMode.Locked; ValidateRotationRestriction(); }
/// Initializes the FpsController on start. private void Start() { slide = sensSlider.GetComponent <UnityEngine.UI.Slider>(); pauseMenu = GameObject.Find("Tutorial").GetComponent <PauseMenu>(); _rigidbody = GetComponent <Rigidbody>(); _rigidbody.constraints = RigidbodyConstraints.FreezeRotation; _collider = GetComponent <CapsuleCollider>(); _audioSource = GetComponent <AudioSource>(); arms = AssignCharactersCamera(); _audioSource.clip = walkingSound; _audioSource.loop = true; _rotationX = new SmoothRotation(RotationXRaw); _rotationY = new SmoothRotation(RotationYRaw); _velocityX = new SmoothVelocity(); _velocityZ = new SmoothVelocity(); ValidateRotationRestriction(); }
/// Initializes the FpsController on start. private void Awake() { _rigidbody = GetComponent <Rigidbody>(); _rigidbody.constraints = RigidbodyConstraints.FreezeRotation; _collider = GetComponent <CapsuleCollider>(); _audioSource = GetComponent <AudioSource>(); arms = AssignCharactersCamera(); _audioSource.clip = walkingSound; _audioSource.loop = true; _rotationX = new SmoothRotation(RotationXRaw); _rotationY = new SmoothRotation(RotationYRaw); _velocityX = new SmoothVelocity(); _velocityZ = new SmoothVelocity(); Cursor.lockState = CursorLockMode.Locked; ValidateRotationRestriction(); standartHeight = _collider.height; standartColliderPosition = _collider.center; tfFirstWeapon = firstWeapon.transform; tfSecondaryWeapon = secondaryWeapon.transform; }
private void Start() { if (entity.IsOwner) { NM.myPlayer = this.entity; } state.nickname = TitleLobbyManager.TLM.myNickname; _rigidbody = GetComponent <Rigidbody>(); _rigidbody.constraints = RigidbodyConstraints.FreezeRotation; _collider = GetComponent <CapsuleCollider>(); _audioSource = GetComponent <AudioSource>(); arms = AssignCharactersCamera(); _audioSource.clip = walkingSound; _audioSource.loop = true; _rotationX = new SmoothRotation(RotationXRaw); _rotationY = new SmoothRotation(RotationYRaw); _velocityX = new SmoothVelocity(); _velocityZ = new SmoothVelocity(); Cursor.lockState = CursorLockMode.Locked; ValidateRotationRestriction(); }
/// Initializes the FpsController on start. private void Start() { _rigidbody = GetComponent <Rigidbody>(); _rigidbody.constraints = RigidbodyConstraints.FreezeRotation; _collider = GetComponent <CapsuleCollider>(); _audioSource = GetComponent <AudioSource>(); arms = AssignCharactersCamera(); _audioSource.clip = walkingSound; _audioSource.loop = true; _rotationX = new SmoothRotation(RotationXRaw); _rotationY = new SmoothRotation(RotationYRaw); _velocityX = new SmoothVelocity(); _velocityZ = new SmoothVelocity(); Cursor.lockState = CursorLockMode.Locked; ValidateRotationRestriction(); //AÑADIDO POR MONCHE ComArduino comArdu = GameObject.Find("Com").GetComponent <ComArduino>(); imu_origin.x = comArdu.imu_x; imu_origin.y = 0f; imu_origin.z = comArdu.imu_y; }