protected override void PhysicsUpdate(float dt) { if (!CanMove) { return; } if (!PlayerBehaviorData.AllowAirControl && IsFalling) { return; } Vector3 fixedDirection = new Vector3(MoveDirection.x, 0.0f, MoveDirection.y); Vector3 velocity = fixedDirection * PlayerBehaviorData.MoveSpeed; Quaternion rotation = Movement3D.Rotation; if (null != Player.Viewer) { // rotate with the camera instead of the movement rotation = Quaternion.AngleAxis(Player.Viewer.transform.localEulerAngles.y, Vector3.up); } velocity = rotation * velocity; if (Movement3D.IsKinematic) { Movement3D.Teleport(Movement3D.Position + velocity * dt); } else { velocity.y = Movement3D.Velocity.y; Movement3D.Velocity = velocity; } base.PhysicsUpdate(dt); }
// Use this for initialization void Start() { movement = GetComponent <Movement3D>(); if (!movement) { movement = gameObject.AddComponent <Movement3D>(); } movement.controllable = false; }
// Use this for initialization void Start() { movement = GetComponent<Movement3D>(); if (!movement) { movement = gameObject.AddComponent<Movement3D>(); } movement.controllable = false; }
void Awake() { if (Instance_3d == null) { Instance_3d = this; } if (Instance_3d != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
private void Update() { if (movement3D == null) { movement3D = GetComponent <Movement3D>(); } if (playerAnimator == null) { playerAnimator = GetComponent <PlayerAnimator>(); } if (FreeLookCam.instance == null) { return; } PlayerAttack(); PlayerMove(); PlayerJump(); }
void Start() { equippedBagPackSpace = GameObject.Find("Equipped Bagpack Space"); playerObject = GameObject.FindGameObjectWithTag("MainCamera"); M3 = GameObject.FindGameObjectWithTag("Player").GetComponent<Movement3D>(); heldBagpackSpace = GameObject.Find("Held Bagpack Space"); arms = GameObject.Find("Arms").GetComponent<ArmsScript>(); bagSlots = GameObject.FindGameObjectsWithTag("BagSlot"); for (int i = 0; i < bagSlots.Length; i++) { if (bagSlots[i] == null) { Debug.Log("ERROR: Missing Object at Inventory System."); } } openSound = GameObject.Find ("BackpackOpenSound"); closeSound = GameObject.Find ("BackpackCloseSound"); retreiveSound = GameObject.Find ("BackpackRetreiveItemSound"); storeSound = GameObject.Find ("BackpackStoreItemSound"); }
void Start() { movement3D = GetComponent<Movement3D>(); }
void Start() { M3 = GameObject.FindGameObjectWithTag("Player").GetComponent<Movement3D>(); currentXRotation = transform.rotation.x; currentYRotation = transform.rotation.y; }
// Use this for initialization void Start() { mover = player.GetComponent<Movement3D> (); playerThere = false; bossCurrentHealth = bossEndurance; }
private void Awake() { movement3D = GetComponent <Movement3D>(); }
private void Awake() { movement3D = GetComponent <Movement3D>(); characterController = GetComponent <CharacterController>(); }
// Use this for initialization void Start() { crossedCheckpoint = false; mover = player.GetComponent<Movement3D> (); anim = gameObject.GetComponent<Animation> (); }
void Awake() { //equippedBagPackSpace = GameObject.Find("Equipped Bagpack Space"); playerObject = GameObject.FindGameObjectWithTag("MainCamera"); M3 = GameObject.FindGameObjectWithTag("Player").GetComponent<Movement3D>(); //heldBagpackSpace = GameObject.Find("Held Bagpack Space"); arms = GameObject.Find("Arms").GetComponent<ArmsScript>(); bagSlots = new GameObject[8]; //initiates bagSlots array and fills it in order. bagSlots[0] = GameObject.Find("BagSlot"); for (int i = 1; i < bagSlots.Length; i++) { bagSlots[i] = GameObject.Find("BagSlot ("+i+")"); } handStartPos = GameObject.Find("RightArm").transform.localPosition; handDefaultRot = GameObject.Find("RightArm").transform.localRotation; for (int i = 0; i < bagSlots.Length; i++) { if (bagSlots[i] == null) { //Debug.Log("ERROR: Missing Object at Inventory System."); } } openSound = GameObject.Find ("BackpackOpenSound"); closeSound = GameObject.Find ("BackpackCloseSound"); //retreiveSound = GameObject.Find ("BackpackRetreiveItemSound"); storeSound = GameObject.Find ("BackpackStoreItemSound"); }
void Start() { movement = GetComponent <Movement3D>(); }