void FixedUpdate()
{
if(Input.GetKeyDown(KeyCode.A))
{
if(isGrounded)
{
rb.velocity = Vector2.up * jumpForce;
}
}
if(Input.GetKey(KeyCode.S))
{
if(!isGrounded)
{
Debug.Log(transform.forward.x + " " + transform.forward.y);
rb.position = transform.forward * Time.deltaTime * boostForce;
}
}
}
It’s a pretty simple code. If you’re not on the ground and you press S, you should be boosting towards the direction the character is going to. But whenever I do this, it returns 0,0 and it makes my code not work obv which is frustrating me.