Search Unity

Character Controller has no collision on network

Discussion in 'Scripting' started by Frostbite23, Jun 4, 2016.

  1. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Hello, I'm currently working on multiplayer for my game. As of everything else I've done, there is always a problem that arises.

    My current players function very nicely, and they use character controllers. But heres the process I go to when this problem occurs.

    1. I build the scene,
    2. I click host server in my unity editor
    3. In my build I then click connect to client. I can see the other player connected, visually everything is fine. But when I throw an object at my player, It goes through, however on the Standalone side, the ball does go through (Or it seems too). Also both players go through eachother on the standalone and in the editor. How can I fix this? If my player and objects dont collide then I cant send information between them!
     
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    Could you check, if the object, that you can pass trough really has a collider?
     
  3. Laperen

    Laperen

    Joined:
    Feb 1, 2016
    Posts:
    1,065
    From my experience, CharacterController cannot collide with anything that is moving. Considering the things you mentioned, projectiles and other players, I'd say this is the main problem.

    Test if any collision is detected at all, do some print statements.

    If there are no prints, check if you have the necessary components as gorbit99 mentioned

    If there are prints, hopefully there is an easy solution someone else can tell you allowing you to continue using CharacterController, because short of writing your own collision, my recommendation is to overhaul your character movement to use Rigidbody.