Skip to content

Instantly share code, notes, and snippets.

@WakkyFree WakkyFree/ShootBall.cs
Last active Sep 19, 2018

What would you like to do?
Unity script to shoot a ball
using UnityEngine;
using System.Collections;
public class ShootBall : MonoBehaviour {
// Use this for initialization
void Start () {
float z = 2000; // force strength;
Rigidbody rigidbody = GetComponent<Rigidbody>();
rigidbody.AddForce(0, 0, -z);
// Update is called once per frame
void Update () {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.