All pastes #2046535 Raw Edit

Anonymous

public text v1 · immutable
#2046535 ·published 2011-04-14 20:17 UTC
rendered paste body
using UnityEngine;
using System.Collections;

public class CreateBall : MonoBehaviour {
	public GameObject projectile;
	private GameObject clone;
	
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetMouseButtonDown(0)) {
			Vector3 mousePos = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10);
			Vector3 putBallHere = camera.ScreenToWorldPoint(mousePos);
			clone = (GameObject)Instantiate(projectile, putBallHere, Quaternion.identity);
			clone.rigidbody.useGravity = false;
			/*
			if (Input.GetMouseButton(0)) {
				clone.transform.Translate(putBallHere);	
			}
			*/
			
		}
	}
}