Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Collision detection problem

Discussion in 'Physics' started by yox3, Apr 14, 2021.

  1. yox3

    yox3

    Joined:
    Nov 18, 2020
    Posts:
    8
    Hello there.
    I'm trying to make an online multiplayer game where I want collision detection when two players bump into each other...

    How can I detect collisions?? if I use OnCollisionEnter(), at least one of the players needs to have a rigidbody and then the players begin to move very weirdly.

    Is there a way where I can make the rigidbody almost do nothing except detecting collisions or a way i don't need to have a rigidbody on my players?

    Hope i can fix this soon... have a nice day!

    (Btw. I'm using character controller to move the player)
     
    Last edited: Apr 14, 2021
  2. diXime

    diXime

    Joined:
    Oct 2, 2018
    Posts:
    162
    Hello,
    If you don't want weird movements when they collide, you can tick "is kinematic" in the RigidBody. It's the "almost nothing" part you're looking for.
    If the collider needs to move, I think you'd still need a rigidbody.

    Nice day to you too !
     
  3. yox3

    yox3

    Joined:
    Nov 18, 2020
    Posts:
    8
    Thanks man!