Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. void Update ()
  2. {
  3.  
  4. if (Input.GetKeyDown ("1")) {
  5. Instantiate (Cube);
  6. }
  7. if (Input.GetKeyDown ("2")) {
  8. rigidbody.isKinematic = false;
  9. }
  10. if (Input.GetKeyDown ("3")) {
  11. rigidbody.isKinematic = true;
  12. }
  13. if (Input.GetKeyDown ("4")) {
  14. GameObject CubeClone = GameObject.Instantiate (Cube, transform.position, transform.rotation) as GameObject;
  15. CubeClone.rigidbody.isKinematic = false;
  16. }
  17.  
  18.  
  19. }
  20.  
  21. }
  22.  
  23.  
  24.  
  25. And this is my collider object that destroys stuff it touches (I may have gotten help with this one :p):
  26.  
  27. public class Emancipation : MonoBehaviour {
  28.  
  29. void OnTriggerEnter(Collider anthrax){
  30. Destroy(anthrax.gameObject);
  31. }
  32.  
  33. void grill() {
  34. collider.isTrigger = true;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement