Hi,I’m new to scripting and Unity and everything. I’m watching a step by step tutorial on making a ball rolling game on Youtube. Even though i wrote the script exactly as the Youtuber did, every time i press w(which i scripted to make the ball jump) my ball does nothing,it can only roll to the left and right. Can someone please tell me what I’m doing wrong? I’m using javascript if that helps.
#pragma strict
var rotationSpeed = 100;
var jumpHeight = 8;
private var isFalling = false;
function Update ()
{
var rotation : float = Input.GetAxis (“Horizontal”) * rotationSpeed;
rotation *= Time.deltaTime;
rigidbody.AddRelativeTorque (Vector3.back * rotation);
Thanks for the help but when i put isFalling = true; inside the brackets above,I can only jump once and once only.I want to be able to jump multiple times.Also,where can i find the “code tag by the stickies.”?
Nice find OboShape. Unity ignores it because it’s legitimate. It’s just another function with a different name. Really hard to find. I looked for spelling errors and didn’t see it.