Search Unity

collision of 2 models doesn't work

Discussion in 'Scripting' started by ingoplaczek, Dec 27, 2016.

  1. ingoplaczek

    ingoplaczek

    Joined:
    Jul 19, 2016
    Posts:
    6
    Hello,
    i have 2 Models and the shall trigger an event for collision, i already tryed everything but it won't work..
    no function is working..
    the Assets.7z includes the Ressources folder with the house and the man (script is attached to man)

    Code (CSharp):
    1.     void OnCollisionEnter(Collision myCollision)
    2.     {
    3.         Debug.Log("test");
    4.     }
    5.  
    6.     void OnCollisionEnter()
    7.     {
    8.         Debug.Log("test2");
    9.     }
    10.  
    11.     void OnTriggerEnter()
    12.     {
    13.         Debug.Log("test3");
    14.     }
    please help me,
    best regards
    Ingo
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      79.9 KB
      Views:
      363
    • 2.jpg
      2.jpg
      File size:
      104.1 KB
      Views:
      326
    • Assets.7z
      File size:
      2.7 MB
      Views:
      34
    • house.zip
      File size:
      3 MB
      Views:
      88
    • man.zip
      File size:
      3.2 MB
      Views:
      49
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,175
    You didn't set a mesh in the mesh colliders
     
  3. ingoplaczek

    ingoplaczek

    Joined:
    Jul 19, 2016
    Posts:
    6
    hi, what kind of mash shall i set, so it makes an collision event whe he touches the surface of the house?
    same problem with the house..
    best regardes
    Ingo
     
  4. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,175
    If this is is a house you should be able to enter when playing with the character, then I'd suggest the original meshes for now
     
unityunity