Search Unity

Sample project errors with unity 5

Discussion in 'Editor & General Support' started by TheKidMSX, Mar 9, 2015.

  1. TheKidMSX

    TheKidMSX

    Joined:
    Mar 9, 2015
    Posts:
    2
    Since I've updated to unity 5, I have several errors with the sample projects.

    Project stealth to Unity 5, I've got 6 error messages saying "NpShape::setFlag(s):triangle mesh and heightfield triggers are not supported!"

    Project Survival Shooter says "Failed to create agent because there is no valid NavMesh. UnityEngine.Object:Instantiate(Object, Vector3, Quaternuion).
    And later it says "Set Destination" can only be called on an active agent that has been placed on a NavMesh.
    As a result the enemies won't show anymore ??

    Project Space Shooter says "Non-convex MeshColliders with non-kinematic Rigidbodies are no longer supported in Unity 5.0.
    As a result the spaceship can't be destroyed by the astroids.

    Does anybody know how to fix these problems ?

    Kind regards,
    TheKidMSX.
     
  2. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    Hey there,

    Thanks very much for reporting these issues.

    The Stealth project has a few issues because of the way mesh colliders work in Unity 5. Unfortunately the changes to fix this project would need to be quite extensive and it would also require redoing a lot of the tutorial content that goes with it. At the moment we are debating whether to patch this up or to create new content that is more suited to Unity 5.

    The Survival Shooter was again made in Unity 4 however we are working on a Unity 5 version and hope to have this ready soon. This will either replace or join the current version on the Asset Store.

    Unfortunately I didn't work on the Space Shooter project so I am not well placed to comment on what's going wrong. I will discuss it with those involved and see if we can put out a fixed version.

    James
     
  3. Axefan

    Axefan

    Joined:
    Mar 10, 2015
    Posts:
    1
    For the Space Shooter project, the only mesh collider being used is on the player. Make sure that the "Convex" checkbox is unchecked for the Mesh Collider component of the Player game object. Also make sure that the "Is Kinematic" checkbox on the Rigidbody component is unchecked (it should be already).
     
  4. TheKidMSX

    TheKidMSX

    Joined:
    Mar 9, 2015
    Posts:
    2
    Okay, thanx. Got the space shooter working again :)
     
  5. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Also, while going through the tutorial at the end of phase 4, for some reason the Zombunny kept navigating to origin and wouldn't follow the player around despite being properly tagged as "Player." It did however work fine when I changed the script reference to Player1 and tagged the Player object in the Hierarchy with the newly created Player1 tag.
     
    tvmaasjazz likes this.
  6. Westyfu

    Westyfu

    Joined:
    Mar 30, 2015
    Posts:
    16
    I found a simple fix for the Navmesh problem in Survival Shooter for anyone else looking,

    Open the Navigation window in the Window menu, should open next to Inspector and when selected you can see "Navmesh Display" on the Scene view, the imported Navmesh makes it so the very tops of things are walkable (in blue) and not the floor, so the Agent can't find it.

    make sure all the Decorations under the Environment GameObject are set to Not Walkable besides "Floor" in the Navigation pane, find the "Floor" GameObject (Not the one inside Environment), give it back a Mesh Renderer Component (should turn pink with no material), set it to Walkable in Navigation, select All props and floor, hit Bake on the bottom of the bake tab.

    once baked, Remove the Mesh Renderer Component added to the Floor.

    using the Floor inside Environment leaves gaps where the Wooden floorboards meet in places, the one outside is a flat quad.
     
    Albob and malcomxoak like this.
  7. chooper

    chooper

    Joined:
    Mar 29, 2015
    Posts:
    1
    Thanks Westyfu.
    Unfortunately your solution alone didn't work for me :(
    I compared my project to the one in _CompletedAssets and noticed the Baked Agent Size setting were different. Since the tutorial has different parameters in this section, we all had to just guess. I copied the setting from this section to my project and it works now. Perhaps my Voxel Size was too large and the Agent couldn't reach the NavMesh? Anyways, here are my settings that worked (from the _CompletedAssets Level included in the demo download)

    Menu>Window>Navigation (Bake Tab)

    AgentRadius 0.75
    Agent Height 1.2
    Max Slope 45
    Step Height 0.2

    Drop Height 0
    Jump Distance 1

    Manual Voxel Size [ * ]
    Voxel Size 0.015

    Min Region Area 0.01
    Height Mesh [ ]

    It takes longer to build... but it works !!

    -c

    UPDATE:
    I'm not convinced my settings had anything to do with this working now. I tried some less accurate settings and it still worked (and baked MUCH faster):

    Step Height 0.29
    Voxel Size 0.1875
     
    Last edited: Apr 10, 2015
  8. LeeM007

    LeeM007

    Joined:
    May 15, 2015
    Posts:
    2
    **Fixed**
    my original post
    the fix
     
    Last edited: May 19, 2015
  9. icecub

    icecub

    Joined:
    Jun 8, 2015
    Posts:
    2
    I've tried both fixes of Westyfu and chooper but I still can't get the Survival Shooter to work. I mean, it works perfectly fine inside Unity 5. It just doesn't work when I compile it. Enemies spawn, but simply don't move.

    Edit: I've also noticed that the Score text and Game Over screen don't work after compiling.

    Lastly the gun ray is black instead of yellow for me. This happens both inside Unity and after compiling.
     
  10. Hydropulse17

    Hydropulse17

    Joined:
    Jan 26, 2014
    Posts:
    22
    Westyfu's fix worked for me, but I had to figure it out because he didn't explain very well and added more steps than were necessary. Do this:

    1. Select floor in the hierarchy, at the very top of the list.
    2. Add mesh renderer component
    3. At the top left of the screen, access Window>Navigation
    4. With the Floor selected, check Navigation Static
    5. Make sure the Navigation Area menu is set to Walkable
    6. Press bake in the bottom right
    7. Delete mesh renderer on the floor to remove all the pink that has appeard
    8. Play
    9. Once you're bored, click player in the hierarchy and select gunBarrelEnd
    10. Set damage to 100
    11. Use the scene view to raise the player up while game is still running and let tons of enemies collect beneath you
    12. Lower player in safe area
    13. KILL EVERYTHING and be bored again

    I also coded for ammo and power ups. It's a fun exercise, you should try it.
     
  11. Huayruro

    Huayruro

    Joined:
    Sep 7, 2014
    Posts:
    1
    I couldn't make Survival Shooter Sample to work on Unity5 despite working OK in Unity4.
    The enemies kept spawning inside drawers or walls and couldn't move towards my player, despite moving the SpawnPoints almost to the center of the game.
    I just read Hydropulse17 step by step and now it Works :D Thanks
     
  12. genergabasa

    genergabasa

    Joined:
    Jan 26, 2015
    Posts:
    1
    This thread helped me too, so the solution was to check Navigation Static in Navigation Objects for the Floor object. Thanks Westyfu's
     
  13. icecub

    icecub

    Joined:
    Jun 8, 2015
    Posts:
    2
    Sorry Hydropulse17, but it's not working for me. Yes I see the pink floor after Bake and I deleted the mesh renderer. Clicking Play works perfectly fine. But Build and Play results in issues mentioned before.
     
  14. dubbist

    dubbist

    Joined:
    Sep 10, 2012
    Posts:
    7
  15. SteveTheRed

    SteveTheRed

    Joined:
    Jul 23, 2015
    Posts:
    1
    I encountered this too, and dug a little deeper.

    I made "player" public, and when run this showed that the Zombunny was following Player(clone), not Player.

    Intrigued, I added
    Code (CSharp):
    1.     public GameObject[] players;
    and changed the initial search to
    Code (CSharp):
    1.         players = GameObject.FindGameObjectsWithTag ("Player");
    2.         player = players [0];
    which reported that players had a length of 2, of which the first was Player(clone), and the second was Player.

    Changing the index on the second line to "players.Length - 1" (the last element of the array) made the Zombunny chase me properly.

    I have no idea where the cloned player object is coming from. I'm using 5.1.1f1
     
  16. Synyster27

    Synyster27

    Joined:
    Nov 28, 2015
    Posts:
    1
    So, 6 months on is there any update on some tutorials that actually work with unity5?
    Or an updated .pdf that includes Hydropulse17's fixes?

    Guess they're still debating? It's really setting me back as a newbie.
     
  17. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    We're not supporting Stealth with Unity 5.

    However there are lots of other full game tutorials that you can learn from.
     
  18. moconchap

    moconchap

    Joined:
    Jun 1, 2017
    Posts:
    5
    whats going on with the max slope and step height its telling me that the specs in the tutorial are unwalkable and then gave me specs to use and or change to. Is this going to interfere with the rest of the game? Just don't want to change the specs and then hit bake only to find out that what I did messed up. TIA
     
  19. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    @moconchap the reason for those settings is the floor in the Survival Shooter game is the floor is uneven and this is to try and get a complete bake for the whole game area. In more recent versions of Unity the algorithms for calculating walkable areas have changed so the original settings might not work anymore. There is a work around outlined by Hydropulse17 above using steps 1 to 7. The rest of the steps won't affect your nav mesh but do sound fun!
     
    moconchap likes this.
  20. moconchap

    moconchap

    Joined:
    Jun 1, 2017
    Posts:
    5
    Thank you JamesB!!
     
  21. AlexDP85

    AlexDP85

    Joined:
    Sep 3, 2017
    Posts:
    2
    Hydropulse17, thanks a lot! This worked perfectly in my case.