Search Unity

Converting an existing player script into a networking enabled script...

Discussion in 'Scripting' started by beatsncredible, Mar 18, 2019.

  1. beatsncredible

    beatsncredible

    Joined:
    Nov 19, 2014
    Posts:
    9
    Hello all, I am new here. I have read and watched numerous documents and videos about setting up networking. I have the basics down, but my already written player movement script isn't working anymore. I tried adding the networking functions to it. it spawns on the level in the proper place, but the player wont move. Can someone show me an example of a player script and a modified version?
     
  2. Kobaltic1

    Kobaltic1

    Joined:
    Jan 22, 2015
    Posts:
    183
    Which networking program are you using?
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You should mention what networking API you are using. Don't use Unet by the way, since it is deprecated and being removed in the next few months.
     
  4. beatsncredible

    beatsncredible

    Joined:
    Nov 19, 2014
    Posts:
    9
    I am using Unet.
     
  5. beatsncredible

    beatsncredible

    Joined:
    Nov 19, 2014
    Posts:
    9
    I am very new, and I am clueless on how to use the others as some of the implementation is beyond my skill level. Unet has tons of video tutorials.
     
  6. beatsncredible

    beatsncredible

    Joined:
    Nov 19, 2014
    Posts:
    9
    So, what do you suggest I use? Unet was very easy to implement.
     
  7. Kobaltic1

    Kobaltic1

    Joined:
    Jan 22, 2015
    Posts:
    183
    Switch to mirror. It is free and on the asset store and is basically the same as Unet.
     
  8. beatsncredible

    beatsncredible

    Joined:
    Nov 19, 2014
    Posts:
    9
    I hope is easier than photon and dark rift2 to understand.
     
  9. Kobaltic1

    Kobaltic1

    Joined:
    Jan 22, 2015
    Posts:
    183
    It is unet. Well almost. You can use the same commands and such. If you know Unet you won't have any problems. Just change the using unity.networking to using mirror and you will be good to go.
     
  10. beatsncredible

    beatsncredible

    Joined:
    Nov 19, 2014
    Posts:
    9
    I just imported mirror into my project and it gave me 265 errors. I cant add any of the scripts because the compiler wnats me to fix all of the errors first. I don't think Mirror is going to work. Any other suggestions?
     
  11. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Head over to the Connected Games forum instead of here and take a look at any of the other networking API's discussed there to see what looks to be a fit for what you are trying to create. You can also ask about your specific errors in the Mirror thread if you want to go with it. You haven't mentioned what they are, so no idea what your issue is.
     
  12. Kobaltic1

    Kobaltic1

    Joined:
    Jan 22, 2015
    Posts:
    183
    I never had a single error with mirror on 3projects now. One was converted from Unet. What version of Unity are you using?
     
  13. beatsncredible

    beatsncredible

    Joined:
    Nov 19, 2014
    Posts:
    9
    2018.2.0f2