Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update ()
- {
- if (Input.GetKeyDown ("1")) {
- Instantiate (Cube);
- }
- if (Input.GetKeyDown ("2")) {
- rigidbody.isKinematic = false;
- }
- if (Input.GetKeyDown ("3")) {
- rigidbody.isKinematic = true;
- }
- if (Input.GetKeyDown ("4")) {
- GameObject CubeClone = GameObject.Instantiate (Cube, transform.position, transform.rotation) as GameObject;
- CubeClone.rigidbody.isKinematic = false;
- }
- }
- }
- And this is my collider object that destroys stuff it touches (I may have gotten help with this one :p):
- public class Emancipation : MonoBehaviour {
- void OnTriggerEnter(Collider anthrax){
- Destroy(anthrax.gameObject);
- }
- void grill() {
- collider.isTrigger = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement