Collision of object with player

后端 未结 1 942
谎友^
谎友^ 2021-01-29 15:26

So I have a bit of an issue with some unity script (Another one, I\'ve given up any interest of using unity outside of my required class projects). So I have a moving object, a

相关标签:
1条回答
  • 2021-01-29 15:38

    Interesting suggestion from your teacher. I would put a character controller on your player, which you seem to have already. Then I would add the collision code:

    void OnCollisionEnter(Collision c)
    {
       // die.
    }
    

    Then add a box Collider and Rigibody to the roof. I would also add this code above to the roof.

    0 讨论(0)
提交回复
热议问题