I can’t make my character jump (this is 2D btw)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Move2D : MonoBehaviour
{
public float jumpSpeed = 5f;
public float moveSpeed = 5f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0f, 0f);
transform.position += movement * Time.deltaTime * moveSpeed;
_ = new Vector3(Input.GetAxis("Vertical"), 0f, 0f);
transform.position += movement * Time.deltaTime * jumpSpeed;
}