Search Unity

Merry Fragmas 3.0 Q&A

Discussion in 'Community Learning & Teaching' started by richardboegli, Dec 29, 2016.

  1. Darkloud89

    Darkloud89

    Joined:
    Apr 16, 2017
    Posts:
    1
    Hey guys! Hoping anyone could help me. I've got everything set up correctly I believe but I cannot drag and drop ANY particle effects onto my Shot Effects script? FirePosition works fine for the transform but the " Shot Effects " field says None (Shot Effects Manager) and I cannot drag and drop anything on to it... Any ideas?
     
  2. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    Out if curiosity, can the scripts be used commercially in Merry Fragmas 3.0?
     
  3. greatkourosh

    greatkourosh

    Joined:
    Apr 26, 2017
    Posts:
    3
    cjessup87 and Manuj like this.
  4. ronaldomoon

    ronaldomoon

    Joined:
    Jan 24, 2014
    Posts:
    87
    Just finished up the last video and had a few issues which I was able to resolve thanks to previous posts on this thread. There is one issue that still persists however. While playing as a client, I can kill the server player and the death animation plays as it should. When I kill a client as the server player, the gun disappears but the death animation does not play. Instead the client player just stands there, not moving at all, until it is respawned.

    Note: I am using two animation layers with an avatar mask to make the upper body always aiming the pistol since I didn't buy the soldier asset used in the video and don't have access to those animations. However, I don't think that's the problem as it works fine when the server player dies. Both layers use the same death animation, the only thing that's different is I have a "pistol ready" animation that overrides the locomotion blend tree (for the upper body only) in the base layer. Both layers are set to go from any state to the death animation when the "Died" trigger is activated.

    Edit: Just checked the client player's animator controller in the editor and "Died" is not getting triggered. It does for the server player though. Weird...

    Edit2: Just noticed I'm also having the issue where the client health text starts at 0 in the beginning of the match then goes to 2 once shot. The client also respawns in the same place every time but the server player doesn't.
     
    Last edited: Jun 21, 2017
  5. Mike-Geig

    Mike-Geig

    Unity Technologies

    Joined:
    Aug 16, 2013
    Posts:
    254

    Hmm, it's been a while but I seem to remember a change to how the syncvars worked. If the client always has 0 health because the value wasn't updated, that could be a problem. Then again, that is only guess work without see the project or scripts you are using.
     
  6. ronaldomoon

    ronaldomoon

    Joined:
    Jan 24, 2014
    Posts:
    87
    I'm uploading it to dropbox right now. I'll e-mail you the link when it's done.
     
  7. ronaldomoon

    ronaldomoon

    Joined:
    Jan 24, 2014
    Posts:
    87
    For anyone watching this thread, waiting for a fix- please note that Mike is busy with Unite Europe right now and won't be able to take a look at my package (hee-hee) until he gets back and has some free time. Either he or I will post the fix(es) here when that time comes.
     
    Westland likes this.
  8. Mike-Geig

    Mike-Geig

    Unity Technologies

    Joined:
    Aug 16, 2013
    Posts:
    254

    So the problem is that you mis-typed the ClientRpc attribute in the PlayerHealth script.

    Code (CSharp):
    1. [Client]
    2. void RpcTakeDamage (bool died)
    Should be

    Code (CSharp):
    1. [ClientRpc]
    2. void RpcTakeDamage (bool died)
     
  9. ronaldomoon

    ronaldomoon

    Joined:
    Jan 24, 2014
    Posts:
    87
    Wow. I would like to say I can't believe it was something so simple, but that's usually what it tends to be. Thanks, Mike!
     
  10. Mike-Geig

    Mike-Geig

    Unity Technologies

    Joined:
    Aug 16, 2013
    Posts:
    254
    :)
     
  11. ronaldomoon

    ronaldomoon

    Joined:
    Jan 24, 2014
    Posts:
    87
    So after making the change I had both players disappearing on death so I made the following changes to Player.cs and now it works like a charm:

    Code (CSharp):
    1.     void DisablePlayer ()
    2.     {
    3.         onToggleShared.Invoke(false);
    4.  
    5.         if (isLocalPlayer)
    6.         {
    7.             PlayerCanvas.canvas.HideReticule();
    8.             mainCamera.SetActive(true);
    9.             onToggleLocal.Invoke(true);
    10.         }
    11.         else
    12.         {
    13.             Invoke("DisablePlayerGFX", respawnTime - 1f);
    14.         }
    15.     }
    16.  
    17.     void DisablePlayerGFX()
    18.     {
    19.         onToggleRemote.Invoke(false);
    20.     }
     
  12. ronaldomoon

    ronaldomoon

    Joined:
    Jan 24, 2014
    Posts:
    87
    Ok, don't do this. I don't know what was causing the players to instantly disappear before, but the "solution" I posted here doesn't work because they players stay invisible after respawning. I switched the code back to the way it was before and now they fall down and die as they should and don't simply insta-disappear as they did before. o_O
     
  13. pixelone

    pixelone

    Joined:
    Apr 16, 2010
    Posts:
    157
    @Mike-Geig or any one with a workable solution based on MF 3.0 video series MG did. With the new Unity Networking approach taken, how do you solve for the weapon clipping int the walls? I tried adding a new camera w/:
    - Added camera called "GunCam"
    - Render Depth Only
    - Depth at 0 (Main Camera at -1)
    - Added a layer (weapon camera)
    - changed GunCam to only layer weapon camera
    - changed main camera to not see weapon camera layer

    Works as in intended. Gun no longer clips into walls, but I can see all the other networked players guns through walls. Because it is rendering over the main camera. How do I fix this?

    Thanks in advance.
     
  14. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    Hey @Mike-Geig

    You lightly touched on networked Ragdolls. How would you do networked ragdolls in Merry Fragmas 3.0? Also I'm using the the onToggleShared,Local, and Remote. How can these events work if their is more scripts to make up parts of a controller (character controller, FPS controller, etc)?

    Thanks!!
    NuclearRasberry
     
    Last edited: Aug 15, 2017
  15. FeaturedSpace

    FeaturedSpace

    Joined:
    Apr 21, 2017
    Posts:
    3
    @Mike-Geig Please help me!

    I recently noted that this new feature in Unity 5.6 has added in this new error where if your player is a prefab, it cannot spawn in a build. I don't know quite how to fix this, and I have tried some of the rudimentary workarounds that have been provided by other users on the forums. None of them seem to work for me.

    Some values that might help:
    Scene_id: 1 (when hosting on the unity testing area)
    (I don't really know what to put here. Nothing works on the build xD)

    I have an issue, I keep on getting this error when attempting to run the game. This is after 36:51 in the video when he is run-testing it.

    Error:
    GameObject Player is a prefab, it can't be spawned. This will cause errors in builds.
    UnityEngine.Networking.NetworkManagerHUD:OnGUI()
     
    Last edited: Aug 26, 2017
  16. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    can that Unity event thing you did in Player.cs carry on to other things (Third person, RTS, etc)? @Mike-Geig

    Thanks,
    NuclearRasberry
     
  17. barney543210

    barney543210

    Joined:
    Oct 22, 2017
    Posts:
    2
    The issue involving
    Spawn scene object not found for 1
    UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()
    (i.e. client not spawning) is not being resolved by removing network identity and re-adding it. Any other suggestions? @Mike-Geig @ronaldomoon
     
  18. barney543210

    barney543210

    Joined:
    Oct 22, 2017
    Posts:
    2
    I've solved the problem (at least for the time being) for Spawn Scene object not found for 1. When adding the player prefab to the network manager, before adding it, remove the player from the scene. This seems to work every time now
     
  19. TaintedEnergy

    TaintedEnergy

    Joined:
    Feb 21, 2015
    Posts:
    3
    Hey Mike, I know you might have a 4.0 coming out soon, but I think this may still affect the next one. So I've made a multiplayer game and everything works fine. Ive tested it out with a couple of my friends, and they could also join. One problem I have though is that some of my friends can't see or join my games. They seem to be able to make their own games and join them, but my initial testing friends and I cant join him. This makes it seem like he is the problem, but I still dont know why he can make his own server and play by himself. He has tried turning off his anti-virus and firewall, but this doesnt seem to affect anything. Is there a way that I can detect what his problem is? Is there a way I can maybe print the port hes connecting to or something? Im not too good with Networking and what port makes stuff work or whatever, but I though this may be the last place I may find help. I also stumbled upon this: https://forum.unity.com/threads/unity-can-connect-only-on-localhost-no-external-ip.166996/ which wasnt extremely encouraging. I really want all of my friends to be able to connect to me, or me to any of them, as if I were to release my game others would have similar problems. I followed your 3.0 tutorial step by step, and I would really hate to now have to redo everything and try photon. Again, I dont know much about the networking but is there a way I can just implement the photon server side stuff really easily to potentially fix this? Remember, I havent tried everything yet, but I do want to try anything to fix this. All I have done so far is build the game, give it to my friend, make a server and get him to try join. I also tried to get him to direct connect to my IP. I really just want a solution, any solution or all solutions. Any ideas?
     

    Attached Files:

  20. TaintedEnergy

    TaintedEnergy

    Joined:
    Feb 21, 2015
    Posts:
    3
    Also the "Use WebSockets" was disabled when testing, not sure if that would matter or not...
     
  21. TaintedEnergy

    TaintedEnergy

    Joined:
    Feb 21, 2015
    Posts:
    3
    Whoops, almost forgot @Mike-Geig
     
  22. Flame_

    Flame_

    Joined:
    Jun 4, 2017
    Posts:
    1
    @Mike-Geig


    I am experiencing the same issue, and are also looking for a solution. This problem is extremely frustrating, please respond as soon as you get the chance. Thanks.
     
  23. omerselman

    omerselman

    Joined:
    Mar 5, 2016
    Posts:
    20
    Dude did you find out how to solve this?
    In my case, when a player dies, Onenable works but doesnt set health value to maxhealth value.. If you have a solution let me know please.
    nevermind i found it.
    Use a command to reset health.
     
    Last edited: Mar 17, 2018
  24. MrRIU5

    MrRIU5

    Joined:
    Feb 12, 2014
    Posts:
    1
    can i have the project link? especially in the prefabs folder
     
  25. AbhinayNegi

    AbhinayNegi

    Joined:
    Dec 22, 2017
    Posts:
    17
    I followed this tutorial and when I am using Matchmaker it causes me some delay. Especially when I try to fire it first goes to the server using [Command] and then comes back through [RPC] and this causes a very noticeable delay on the clients. Is there any way to fix or optimize this?