Created
March 9, 2020 15:40
-
-
Save EsteveSegura/b218595cacaded9b958f5bee184bd105 to your computer and use it in GitHub Desktop.
Ball controller.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Ball : MonoBehaviour{ | |
public Rigidbody rb; | |
public float force; | |
void Start(){ | |
force = 400f; | |
rb = GetComponent<Rigidbody>(); | |
} | |
public void Jump(){ | |
rb.AddForce(new Vector3(0,1 * force,0)); | |
} | |
public void Forward(){ | |
rb.AddForce(new Vector3(0 , 0 , 1 * force)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment