I’m just getting into UnityScript. I’ve been teaching myself it for about 1-2 hours now but I’m stuck on making a character jump. I’ve understood the moving stuff but this one’s got me. Although I’ve seen ways to do it, I’ve insisted to try and figure out a way myself. I was thinking, you could just create a speed variable and make the object go up the Y axis in that speed. And then wait like 0.3 seconds and go down the Y axis with a “gravity” variable? I’m pretty sure I sound really stupid but I only started today so I’m new to it. Is there any way that will work? (I’m currently away from my computer).
Depends on how you move your character.
If you are usign a rigidbody, simply add force to the y direction.
If you are using a character controller you add speed to your y direction and then start substracting the gravity in the following frames.
If you are using transform you could also add a y speed variable which you set on input and then start substracting the gravity until youre grounded again.