Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to make a character jump c#

public Rigidbody rb;

public float jumpForce;

void Awake() 
{
  rb = GetComponent<Rigidbody>();
}

void Update() 
{
	  if(Input.GetKeyDown(KeyCode.Space)) 
	{
	  rb.AddForce(0, 10 * jumpForce * Time.deltaTime, 0)
	}
}
 
PREVIOUS NEXT
Tagged: #character #jump
ADD COMMENT
Topic
Name
1+1 =