Need Help Making My First Jump Script Help Would Be Appreciated!

Hey there, welcome to the forums!
Please look at this page for how to post code on the forums (so it’s nice!).

You can edit your post :wink:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Jump : MonoBehaviour {
public bool isGrounded = true;
public float JumpSpeed = 10;
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
   if (Input.GetKeyDown (KeyCode.W))
   {
      float yAxis = Input.GetAxis("Vertical");
       if (isGrounded = true)
       {
           Vector3 movement = new Vector3(0, yAxis, 0) * JumpSpeed * Time.deltaTime;
       }
    }
}
}

Okay, does your character have a rigidbody on it?
If so, you have missed a step (assigning your new upward movement).
Right now, all you do is assign the movement, but never use it.
Oh, and by the way, you have “isGrounded = true” which should be “isGrounded == true”

Tell us if you’re using a rigidbody or not, and someone can hopefully help you get it working :wink:

2 Likes