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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

MerryFragmas Help

Discussion in 'Editor & General Support' started by klixoft, Nov 28, 2017.

  1. klixoft

    klixoft

    Joined:
    Nov 28, 2017
    Posts:
    8
    hello, new to unity and following the tutorial for merry fragmas for a networking assignment for my course. I have completed the 3 videos i assume some changes were made to a few of the assets during updates over time. I listed the more tedious issues i came across,
    1. When i try to do matchmaking the room doesn't get created just gets stuck on connecting. unityhelp1.png

    2. Even tho the player name and color is set the only the server can see the names even for the bot, it doesnt get replicated on the client. I am used to unreal so i say replicated i do not know if unity has another term for it.
    unityhelp2.png unityhelp3.png
    3. if i remove from animator from the stealth soldier prefab it break the unit unityhelp4removed animator.png

    I hope i got the terminology correct, for the most part i can resolve the other issues on my own through trial and error i believe. I didnt include gui so i dont have a visual tracker for health or end game but it does end and restart, so i commented out most of that stuff.
    I had made my project already but my prof said make it networked at its core it is a fps shooter.
    Thanks in advance
     
  2. Mike-Geig

    Mike-Geig

    Unity Technologies

    Joined:
    Aug 16, 2013
    Posts:
    235
    Hmm, this is a tough one to diagnose.
    1)My assumption on the first one is a permission issue? Got a firewall that may be blocking it? Have you enabled multiplayer and are you signed in?
    2) I seem to remember others having this issue too. Can you post code?
    3) I don't know what you mean? You are removing the animator from the character game object? I believe code references that animator, so without it you will have errors
     
  3. klixoft

    klixoft

    Joined:
    Nov 28, 2017
    Posts:
    8
  4. Mike-Geig

    Mike-Geig

    Unity Technologies

    Joined:
    Aug 16, 2013
    Posts:
    235
    Can I see your code? I need to make sure you didn't comment out something that was necessary.
     
  5. klixoft

    klixoft

    Joined:
    Nov 28, 2017
    Posts:
    8
    Sure i have attached all the scripts i used
     

    Attached Files:

  6. Mike-Geig

    Mike-Geig

    Unity Technologies

    Joined:
    Aug 16, 2013
    Posts:
    235
    Regarding item #2, try adding these two lines to the Start() method of the Player script:

    Code (CSharp):
    1. OnColorChanged (playerColor);
    2. OnNameChanged (playerName);
     
  7. klixoft

    klixoft

    Joined:
    Nov 28, 2017
    Posts:
    8
    :) Thanks so much everything's working now, Matchmaking worked once i did the setup online.

    I will be adding the remaining stuff from my first project to this one. in terms of organizing and arrangement i have a few queries.

    My project is essentially a clone of the bombing run mode of Unreal Tournament, if you arent familiar with it there is a game called supraball that is similar in a way, sports themed. I have the ball logic that handles passing, shooting, tackling and that stuff which i think i will put on the server.

    I was thinking of making a game manager to handle the scoring but i could simply follow your method, so i assume by doing that a game manager would not be needed.

    Another main concern of mine is how would i set up a team game? I was thinking of using an enumerator to separate and group them.

    For AI i will purchase the asset recommend in the video
     
  8. klixoft

    klixoft

    Joined:
    Nov 28, 2017
    Posts:
    8
    Hello, I just had one last thing i needed help with, It has to do with displaying a projectile on the client. i followed this UNet tutorial: https://docs.unity3d.com/Manual/UNetSetup.html
    I made a separate project using that and it works. I implemented that same method into the merry fragmas clone, but it only displays on the server, when the client fires it also only shows on the server.

    I tried just adding the projectile to the player prefab then instantiating it that also works but it only spawns on the server.

    I attached the script i changed, i put the prefab in using the inspector and it has a network identity and networktransform and is put in the network manager. just refuses to be displayed on the client
     

    Attached Files:

    Last edited: Dec 2, 2017
  9. Mike-Geig

    Mike-Geig

    Unity Technologies

    Joined:
    Aug 16, 2013
    Posts:
    235
    Did you register is with the network manager as a spawn able prefab? Also, ensure that you didn't check "server only" on the network transform of the projectiles.
     
  10. klixoft

    klixoft

    Joined:
    Nov 28, 2017
    Posts:
    8
    I did all that, before doing the merry fragmas tutorial i had completed the UNet one.
    networkmanager.png bulletprefab.png

    it doesnt get replicated on the client. bt it does get spawned on the server. On the right is the client shot gets fired but it is only spawned or shown on the server
    shotfired.png
     
  11. Mike-Geig

    Mike-Geig

    Unity Technologies

    Joined:
    Aug 16, 2013
    Posts:
    235
    To confirm, the prefab you are spawning is the asset in the project view and not a copy of the prefab in the scene?
     
  12. klixoft

    klixoft

    Joined:
    Nov 28, 2017
    Posts:
    8
    I feel a bit silly, i have located the issue, I was still thinking i was using the networkmanager to run the game, i found out after doing a test using the old one, that is when i realized the lobby manager had its own network manager like component. It is resolved now.
    Thank you for your time with this.

    I believe i can implement all my previous work into this project now. Do you know of any good tutorials for implementing a multiplayer like setting? i have the lobby i believe i can edit it to work as how a team lobby would, but gettin the player on actual teams is what baffles me
     

    Attached Files:

    Last edited: Dec 3, 2017