Character stuck in ground/can't get character to jump
I've been trying to get my character to jump for the past day and I can't get anything to work. Its not just jumping though, I can't use addforce on the y axis at all. I think something is sticking my character to the ground and I know it's not my only other script I have added (the one to let me move with a,w,s,d) because I tried turning off that script and the problem persisted. I have a character controller, rigidbody (NOT kinematic), and an animator. I think it could have something to do with my animations (I have an idle animation and a running animation when I would move) that's keeping my character from going up on the Y axis but I still don't know what to do PLEASE HELP
Here is my Jump Script: using System.Collections; using System.Collections.Generic; using UnityEngine;
public class Jump : MonoBehaviour {
public float speed = 10f;
public Rigidbody rb;
private void Start()
{
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
float horizontal = Input.GetAxis("Horizontal") * Time.deltaTime * speed;
float vertical = Input.GetAxis("Vertical") * Time.deltaTime * speed;
transform.Translate(horizontal, 0, vertical);
if(Input.GetKeyDown(KeyCode.Space))
{
rb.AddForce(new Vector3(0, 5, 0), ForceMode.Impulse);
}
}
}
Answer by ilgazalsancak2006 · Jun 15, 2020 at 11:23 PM
I don't think the script is the problem. I have a character and he moves and jumps just fine, but when he jumps onto an object with rigidbody, he moves much slower and he can't jump.
Your answer
Follow this Question
Related Questions
jumping for different characters? 0 Answers
How i make a ball jump where i point with my mouse?[3D] 0 Answers
Problems with jumping in Doodle Jump like game 2 Answers
Need help with jumping 0 Answers
My Player Doesn't Jump 0 Answers