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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Networking Multiplayer Collision Issue

Discussion in 'Multiplayer' started by Mako17, Feb 20, 2018.

  1. Mako17

    Mako17

    Joined:
    Jan 16, 2017
    Posts:
    22
    So I have this simple multiplayer game where these balls collide and apply force to each other. Currently, when they collide, the ball that isn't the Local Player doesn't move. So what do I need to do to make it move? The goal is to push one ball off the platform.

     
  2. dominicpoppe

    dominicpoppe

    Joined:
    Feb 10, 2018
    Posts:
    21
    Does your local player have all needed compontens?
    Network Idendity
    Network Behaviour
    Network Transform
     
  3. Mako17

    Mako17

    Joined:
    Jan 16, 2017
    Posts:
    22
    I don't have a component called Network Behaviour, and I checked if there is one, and there isn't.
     
  4. dominicpoppe

    dominicpoppe

    Joined:
    Feb 10, 2018
    Posts:
    21
    You need to give all players the NetworkBehaviour, Network Transform etc.
    The issue is if you don't have the Network Transform it will not actually move the object for the others aswell.
    That's for the MP part.

    Other than that.

    Your players/balls need to have a rigidbody and a collider otherwhise it doesn't work.
    All objects which should collide with something need the rigidbody.
     
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
  6. Ellernate

    Ellernate

    Joined:
    Aug 25, 2017
    Posts:
    81
    Also, when using the Network Transform make sure to sync the rigidbody and not transform since you're utilizing physics
     
    Gogunio likes this.
  7. Mako17

    Mako17

    Joined:
    Jan 16, 2017
    Posts:
    22
    None of that is the problem. I have all that set up correctly.
     
  8. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Post your code?
     
  9. Deleted User

    Deleted User

    Guest

    You have to make a script so the rigidbody forces (velocity and angular velocity) are synced to all players in the session. So you can actually apply force on other players objects aswell.

    -Pablo Discobar
     
    Gogunio likes this.
  10. Mako17

    Mako17

    Joined:
    Jan 16, 2017
    Posts:
    22
    How would I go about doing that?
     
  11. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    NetworkTransform can do that if properly configured. My experience though is that it is not well implemented, and should be just used when prototyping before writing your own or using a 3rd party syncing script.
     
  12. utimago

    utimago

    Joined:
    Feb 28, 2017
    Posts:
    2
    Were you able to solve this? I have the same issue.
     
  13. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Umm, Mako hasn't even logged in since making that post.
     
  14. Seforius

    Seforius

    Joined:
    Jun 25, 2022
    Posts:
    8
    Bumping this thread because I need the answer as well. Someone please enlighten us. Also great game Mako, looks like it will be very successful.
     
  15. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    456
    @Seforius this thread is rather old and Networking libraries have moved on since the previous reply to yours in 2019.

    Are you using the Netcode for GameObjects library or some other netcode library?