void FixedUpdate() { movingSpeed = Input.GetAxis("Horizontal"); if (charstage == 0) { character.Move(movingSpeed, jump); } else { character.Move(0, jump); } //jump is reset after each time that physical engine updated jump = false; }
private void FixedUpdate() { // Read the inputs. // bool crouch = Input.GetKey(KeyCode.LeftControl); // float h = CrossPlatformInputManager.GetAxis("Horizontal"); // Pass all parameters to the character control script. character.Move(jump); jump = false; }
private void Update() { m_Jump = CrossPlatformInputManager.GetButtonDown("Jump"); m_Climb = CrossPlatformInputManager.GetButton("Fire2"); float h = CrossPlatformInputManager.GetAxis("Horizontal"); float v = CrossPlatformInputManager.GetAxis("Vertical"); // Pass all parameters to the character control script. m_Character.Move(h, v, m_Climb, m_Jump); }
private void FixedUpdate() { // Read the inputs. bool crouch = Input.GetKey(KeyCode.LeftControl); float h = Input.GetAxis(horizontalAxis); // Pass all parameters to the character control script. m_Character.Move(h, crouch, m_Jump); m_Jump = false; }
void FixedUpdate() { //get input by Axis set in input setting movingSpeed = Input.GetAxis("Horizontal"); //pass parameters to character script, and then it can move character.Move(movingSpeed, jump); //jump is reset after each time that physical engine updated jump = false; }
// Update is called once per frame void FixedUpdate() { float direction = Input.GetAxis("Horizontal"); character.Move(direction); if (m_Jump) { character.Jump(); m_Jump = false; } }
// Update is called once per frame void Update() { var side = Input.GetAxisRaw("Horizontal"); var forward = Input.GetAxisRaw("Vertical"); if (Input.GetKeyDown(KeyCode.E)) { interactTrigger.Invoke(); } if (Input.GetKeyDown(KeyCode.Q)) { hackTrigger.Invoke(); } character.Move(side, forward); }
void FixedUpdate() { // Read the inputs. bool crouch = Input.GetKey(KeyCode.LeftControl); #if CROSS_PLATFORM_INPUT float h = CrossPlatformInput.GetAxis("Horizontal"); #else float h = Input.GetAxis("Horizontal"); #endif // Pass all parameters to the character control script. character.Move(h, crouch, jump); // Reset the jump input once it has been used. jump = false; }
void FixedUpdate() { character.Move(moveVector * Time.deltaTime); if (alive && Physics2D.IsTouching(dropCollider, contactFilter)) { Collider2D[] targets = new Collider2D[1]; Physics2D.GetContacts(dropCollider, contactFilter, targets); if (targets.Length > 0) { Collider2D coll = targets[0]; switch (coll.tag) { case "Player": Player.Players p = coll.gameObject.GetComponent <Player>().playerChoice; GM.ScorePoints(p, 15); break; default: break; } } alive = false; Rigidbody2D rb = GetComponent <Rigidbody2D>(); rb.simulated = false; dropCollider.enabled = false; spriteRenderer.enabled = false; if (pickupParticles != null) { Vector3 spawn = transform.position; spawn.z = -1f; GameObject b = GameObject.Instantiate(pickupParticles, spawn, Quaternion.identity); } DieForReal(); } }
void FixedUpdate() { if (isPaused) { return; } Vector3 lookPos; //The position that the character should be looking towards Vector3 move; //the world-relative desired move direction, calculated from the lookAtTarget and user input, and then the characterScriptControl bool jump; userControl.solveInput(playerNumber, transform, looksAtTarget, lookAtTarget, out lookPos, out move, out jump); bool onGround; character.Move(lookPos, move, jump, out onGround); scriptControl.rubberBanding(transform, playerIsAttachedTo, onGround); }
void FixedUpdate() { character.Move(horizontalMove * Time.fixedDeltaTime); }
void FixedUpdate() { character.Move(moveVector * Time.deltaTime); }
void FixedUpdate() { movingSpeed = Input.GetAxis("Horizontal"); character.Move(movingSpeed, jump); jump = false; }