- Home /
how to fix my jumping error!,how to fix juming error!
My jumping code is not working but oter are working can you help me and i am new here.
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class j : MonoBehaviour {
public p controller;
public float runSpeed = 40f;
float horizontalMove = 0f;
bool jump = false;
void Update () {
horizontalMove = Input.GetAxisRaw ("Horizontal") * runSpeed;
if (Input.GetButtonDown("Jump"))
{
jump = true;
}
}
void FixedUpdate()
{
controller.Move (horizontalMove * Time.fixedDeltaTime, false, jump);
jump = false;
}
}
,I have made a game and for the player in the game i wrote scripts and my others scripts are working but my jumping scripts is not working can you help me with it and i am new here.here's the script:
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class j : MonoBehaviour {
public p controller;
public float runSpeed = 40f;
float horizontalMove = 0f;
bool jump = false;
void Update () {
horizontalMove = Input.GetAxisRaw ("Horizontal") * runSpeed;
if (Input.GetButtonDown("Jump"))
{
jump = true;
}
}
void FixedUpdate()
{
controller.Move (horizontalMove * Time.fixedDeltaTime, false, jump);
jump = false;
}
}
and if you help i will reward you. thats my promise
Your answer
![](https://koobas.hobune.stream/wayback/20220613020434im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make character controller forward jump a certain distance? 1 Answer
change multiple jump to single jump 1 Answer
Unity physics going against a wall and trying to jump fails while still running at it 0 Answers
I have a problem with my jump script 1 Answer
Player jump not working correctly 1 Answer