r/code • • Feb 05 '20

Start coding

Hello, I am just starting coding and just wanna know how to write a jump script in unity with c#. I looked up for a few videos and couldn’t find anyone helpfull, so can pls someone help me out.

0 Upvotes

2 comments sorted by

1

u/DutchLeopardNL Feb 05 '20

Maybe try a gamedev related sub or the unity one

0

u/Jackplox Feb 06 '20

public float verticalvelocity = 0f; public float jumpForce = 20f; public float gravity = 20f;

if (Input.GetKeyDown(“Space”){ verticalvelocity = jumpForceTime.deltatime; transform.position.z += verticalvelocity - gravity * Time.deltatime; } else{ verticalvelocity= gravitytime.deltatime; transform.position.z = -verticalvelocity; }

maybe

rip cant format