This post has been wikified, any user with enough reputation can edit it.
Question by
usef155 · Oct 08, 2015 at 12:43 AM ·
raycastjumpjumping object
Jump raycast not working
I am trying to type a code to allow my player to only jump when their place on the Y value is 0.5 or less. I have tried using a raycast but the thing it seems to have done is make my jump force from 75 to something a lot weaker. Code:
if (Physics.Raycast (transform.position, -Vector3.up, 0.5f))
{
if (Input.GetButtonDown ("Jump"))
rb.AddForce (0, 75, 0);
}
Comment
Your answer
Follow this Question
Related Questions
Jumping higher the more you hold space! 1 Answer
wall check is always returning true even though the distance doesn't fit my parameters :( 1 Answer
Making an object jump (without rigidbodies), while using enum + gravity 0 Answers
How do/should I make my character jump? 1 Answer
My simple jump script is only letting me jump once? 1 Answer