void Update() { var _playerMovement = new Vector2(_direction.x, 0); if (_isWalking) { //_rb.MovePosition (_playerMovement * _speed * Time.deltaTime, Space.world); _rb.velocity = _playerMovement; } if(_direction.x > 0) { _playerTransform.rotation = Quaternion.Euler (0, 0, 0); } else if (_direction.x < 0) { _playerTransform.rotation = Quaternion.Euler (0, 180, 0); } if (_isJumping) { _rb.AddForce (_jumpForce); } } private void StartMove (InputAction.CallbackContext obj) { _isWalking = true; _direction = obj.ReadValue<Vector2>(); Debug.Log ("YEAHHHHH je marche !!!!"); } private void EndMove (InputAction.CallbackContext obj) { _isWalking= false; _direction = Vector2.zero; Debug.Log ("HHHHHEEEEUUUU je sens plus trop la vibe de la marche !!!!"); } private void JumpStart (InputAction.CallbackContext obj) { _isJumping = true; Debug.Log ("OOOOHHH je peux sauter !!!!"); } private void JumpFinish (InputAction.CallbackContext obj) { _isJumping = false; Debug.Log ("OOOOOOOOOOHHHH je peux plus sauter mais euhhhh !!!!"); }
testsWed, 25 Jan 2023