Skip to content
Permalink
60234aa537
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
29 lines (20 sloc) 597 Bytes
using UnityEngine;
using System.Collections;
public class Ball : MonoBehaviour {
public float ballIntVel = 600f;
private Rigidbody rb;
private bool ballInPlay;
// Use this for initialization
void Awake () {
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void FixedUpdate () {
if (Input.GetButtonDown ("Fire1") && ballInPlay == false) {
transform.parent = null;
ballInPlay = true;
rb.isKinematic = false;
rb.AddForce(new Vector3(ballIntVel, ballIntVel, 0));
}
}
}