You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
407 B

  1. using UnityEngine;
  2. using System.Collections;
  3. public class fence : MonoBehaviour {
  4. private Rigidbody rigidbody;
  5. // Use this for initialization
  6. void Start () {
  7. rigidbody = GetComponent<Rigidbody> ();
  8. }
  9. // Update is called once per frame
  10. void Update () {
  11. }
  12. void OnCollisionEnter(Collision collision) {
  13. if (collision.transform.tag == "moveable")
  14. rigidbody.isKinematic = false;
  15. }
  16. }