- Home /
Question by
RajOTS · Oct 28, 2018 at 04:47 PM ·
not workingbutton trigger events
Button is not working
My function attached to a button is not being called, I have a EventSystem in the hierarchy but it still is being called for some reason can anyone help?
public void JumpHandler()
{
bool isGrounded = Physics.Raycast(transform.position, Vector3.down, distanceToGround);
//If Jumo key is pressed
if (Input.GetButtonDown("Jump") && isGrounded)
{
//Jump Vector
Vector3 jumpVector = new Vector3(0, jumpForce, 0);
//Apply Force
RB.velocity += jumpVector;
}
}
Comment
is the button reacting to mouse enter/ exit? does it their color?
does jumphandler get updated and executed correctly? might debug your function helps.
Your answer
Follow this Question
Related Questions
Facebook SDK - OpenSSL not found when I installed it and set the path multiple times already 1 Answer
UnityWebRequest not working in WebGL build 2 Answers
Player's position won't change no matter what 4 Answers
Boolean From Another Class Not Being Updated 3 Answers
Script not working on clones 1 Answer