Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Tutorial Project: Stealth under Unity 5.x

Discussion in 'Community Learning & Teaching' started by Vagabond820, Mar 10, 2015.

  1. Vagabond820

    Vagabond820

    Joined:
    Mar 10, 2015
    Posts:
    6
    [edit by moderator: This is a community driven thread and is not supported by Unity Technologies. That being said, it's a great initiative, so we are sticking this in the teaching section.]

    Project Link: https://unity3d.com/learn/tutorials/projects/stealth-tutorial-4x-only/stealth-project-overview

    [edited by moderator as link was broken - note link is 4.x]

    I am going through this tutorial again as I was half way through when unity 5.0.0f4 was released and wanted to just redo the first two chapters (never hurts to recover steps). However, I have encountered an issue already and figure several more will exist in future videos. So I am compiling a list here and looking for solutions to these issues.

    Thank You to all contributors.

    Issues ---

    Step 102:

    Fog @ 7:49
    - no solution located.

    Unity 5 removes RenderSettings from the Edit command list and appears to place many of its functions in the Lighting window (Windows -> Lighting). A Fog component can be found under Scene tab of the Lighting window but it will not provide all of the described settings under one Mode. Linear Mode provides a Start and Stop field only while Exponential Mode provides a Density field only. No Mode provides all three.

    Lightmapping @ 9:11
    - no solution located.

    Unity 5 removes Lightmapping from the Windows command list and appears to place many of its functions in the Lighting window (Windows -> Lighting). No Bake tab is available anymore and appears to have been replaced by the Scene tab. The Scene tab appears to provide many of the same functions under different names:
    Mode = General GI -> Directional Mode;
    Quality = ???;
    Bounces = Environment Lighting -> Reflection Bounces;
    Bounce Boost = General GI -> Bounce Boost (min value of 1 not 0, so would it be 1.5 instead of the 0.5 in video);
    Contrast Threshold = ???;
    Interpolation = ???;
    Interpolation Points = ???;
    Ambient Occlusion = Baked GI -> Ambient Occlusion;
    Ambient Occlusion -> Max Distance = Baked GI -> Ambient Occlusion -> Max Distance;
    Ambient Occlusion -> Contrast = ???;
    Resolution = Baked GI -> Baked Resolution;
    Padding = Baked GI -> Padding.
     
    Last edited by a moderator: Jul 13, 2016
  2. Vagabond820

    Vagabond820

    Joined:
    Mar 10, 2015
    Posts:
    6
    saved for chapter 2
     
  3. Vagabond820

    Vagabond820

    Joined:
    Mar 10, 2015
    Posts:
    6
    saved for chapter 3.
     
  4. Vagabond820

    Vagabond820

    Joined:
    Mar 10, 2015
    Posts:
    6
    saved for chapter 4.
     
  5. ikakku

    ikakku

    Joined:
    Jan 6, 2015
    Posts:
    1
    Thanks a lot for putting together these updates, big time saver!

    I have been messing around trying to get the fog to show up in the game window but no luck. besides ticking the fog box and changing the settings as instructed is there anything else that needs to be done to show the fog?

    There is a warning under the fog section "unity fog does not affect opaque objects in Deferred Shading. use global fog image effect". But I have no idea what this means.
     
  6. e_Glyde

    e_Glyde

    Joined:
    Apr 20, 2013
    Posts:
    42
    That means you must apply the "Global Fog" effect on the camera.
    After importing the effects package.
    Camera->Add Component->Image Effects->Rendering->Global Fog
     
  7. groo79

    groo79

    Joined:
    Nov 20, 2014
    Posts:
    11
    Does anyone have an idea as to why the player movement waits a full second before actually moving? My code follows the tutorial except where I had to change to a GetComponent for the audio source, or is nobody else having this issue?
     
  8. e_Glyde

    e_Glyde

    Joined:
    Apr 20, 2013
    Posts:
    42
    What's your frame rate? Is it just the player movement or does all input have a second lag?
     
  9. jyanisko

    jyanisko

    Joined:
    Mar 23, 2015
    Posts:
    2
    You need to tell the animation that it doesn't have an exit time. Click on the transition in the animator, and uncheck "Has Exit Time"
     
    groo79 and Socrates like this.
  10. groo79

    groo79

    Joined:
    Nov 20, 2014
    Posts:
    11
    rotation works as it should. but there is a full second lag on the character actually starting to walk.
     
  11. groo79

    groo79

    Joined:
    Nov 20, 2014
    Posts:
    11
    Thanks, that's all I needed. Definitely will remember that.
     
  12. doctorhr2

    doctorhr2

    Joined:
    Mar 25, 2015
    Posts:
    4
    I feel like I'm on the verge of bashing my head through a table! Trying to get the cctv camera animation working in Unity 5... Why for the sake of sanity are the tutorials so out of date?! Did no one think to redo them for Unity 5? Seriously, to have out of date tutorials on the main site for the newest build of the engine is liable to discourage people. I'm a patient guy and I know how to use Google, but I am fast becoming bored with constantly having to troubleshoot and search.

    Rant over (until the next chapter) Can someone please talk me through getting the cctv camera to sweep left and right? I have googled it but the solutions I have come across don't seem to produce the desired result. I have tried a few different ways of adding the "cctv_sweep" animation file. I have got as far as selecting the "prop_cctvCam_joint" and adding the rotation transform property in the Animation window, but I cannot find an option to Add Curves...

    Update: I think I figured it out myself... Might not work quite how it looks in the video, but at least I can get onto the next bit now. I messed about with the Animation window, put a key frame in at 0 seconds at Y= 0, another at 2 seconds at Y=60 and another at 4 seconds back at Y=0. Seems to work...
     
    Last edited: Apr 6, 2015
  13. groo79

    groo79

    Joined:
    Nov 20, 2014
    Posts:
    11
    Create 2 different states in the animator using the same animation, one playing at positive 1 and one playing at negative 1. then transition from one to the other on a loop. that's how I did it and it works great.
     
  14. groo79

    groo79

    Joined:
    Nov 20, 2014
    Posts:
    11
    Anyone know why my guy doesn't move when he shouts? I followed the tutorial, which we know is severely out of date. he moves just fine now thanks to jyanisko. But, if he is running and I hit shout he stops moving while his legs keep running. is there a way to keep the shout animation from stopping the character from moving?

    **EDIT**
    OK, I figured it out. I had more things selected on the mask than I thought. Deselected the circle below the humanoid body and the IK dots for the limbs I'm not using and it worked.
     
  15. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,671
    Well, we could just remove this project? This is our oldest project, and will not be updated. We have debated simply removing this project from circulation, but many people still want it available as a resource. This thread is a community driven guide to issues that could be found in this project. With hope, solutions to the main issues will be posted here. Bear in mind that we have by far the most extensive section of learning material in our learn for this field. There are volumes of other pieces of learning material on our site. If this one is proving too frustrating, perhaps you should try one of the others. Software is a constantly moving target, and as such, dome of our material will become stale, and will eventually be removed. This project is on that edge ...
     
    Mr B and groo79 like this.
  16. groo79

    groo79

    Joined:
    Nov 20, 2014
    Posts:
    11
    Thanks Adam. I still think for the most part this tutorial is still functional. I'm at the Key tutorial and aside from a few hiccups, I have everything working fine, I even updated all the shaders to standard and tweaked the levels to my own preferences for the look. I think maybe providing a link to some common issues might be helpful, but all in all the tutorial is helping me quite a bit even though it's as old as it is.
     
  17. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,671
    Well, tbh, I was hoping at this thread would provide the details of common issues, discovered by the community.

    Currently, I don't have time to run and annotate this project the same way I've done for the projects I created. There are additional resources that I'd like to create before then, including more detailed lessons on the new graphics and lighting pipeline.

    We have added Matt Schell to our roster of screen casters, and perhaps we will get a third in the future, but with our resource pool, we will be putting as much or more focus on moving forward as we are on updating and upgrading legacy projects to the new version of Unity.
     
  18. doctorhr2

    doctorhr2

    Joined:
    Mar 25, 2015
    Posts:
    4
    I wanted to do this one because it was closest to the sort of game I want to create myself one day, I just wasn't prepared for there to be steps that wouldn't work in Unity 5; bearing in mind that I am completely new to Unity and I only discovered that it existed thanks to a 'Lynda' tutorial on modelling game assets in 3DS Max. Are there any official tutorials written for 5 in particular or is it still too recent?
     
  19. groo79

    groo79

    Joined:
    Nov 20, 2014
    Posts:
    11
    OK, new issue. I got through the whole thing and the guards just walk in circles. if I remove "transform.rotation = anim.rootRotation;" from the EnemyAnimation script and also leave the NavMeshAgent updateRotation as true it seems to fix this issue. wondering if anyone knows why this is? should we not be using root rotation for this anymore?
     
  20. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,671
    Currently there are no tutorials explicitly for Unity 5. I am updating Roll-a-ball for Unity 5 as we speak. All of the projects, except Stealth, should have some sort of upgrade guide available on this forum. This thread should be a good repository of issues. If I get the chance, I'll run stealth and develop a proper upgrade guide, but it's beyond my schedule right now.

    My only personal note is, you've chosen a large and complex project marked as "intermediate" as your first project, and this is bound to cause some headaches simply wrapping your mind around the complexity of the project and novelty of Unity itself. It might be better to run Roll-a-ball and Space Shooter first, and then complete Stealth. Then you should have a solid amount of experience in Unity that might help when running Stealth, so the only challenging tasks would be researching the upgrade changes. In order of complexity, the projects are Roll-a-ball, Space Shooter, Survival Shooter, Roguelike and finally Stealth. At this point we don't have any truly advanced projects.

    If you have more issue post here, or if this thread doesn't work as a community resource, we'll make an official one, and we can discuss Stealth there.
     
  21. groo79

    groo79

    Joined:
    Nov 20, 2014
    Posts:
    11
    I would start with the beginner ones first, The Survival Shooter one is for 4.6 and should translate over well.
     
  22. doctorhr2

    doctorhr2

    Joined:
    Mar 25, 2015
    Posts:
    4
    I have done all the other projects. I've been working through them to try to learn how Unity works, I was hoping that the further I got the more up to date they would be. I managed to figure out where I needed to insert "GetComponent" for the Space Shooter and to refer to the DoneScripts if something wasn't working on mine. It's mainly where something has seemingly completely changed that throws me, like the GUI, Lightmap baking. In future I will be sure to make more use of the forums.
     
  23. kubajs

    kubajs

    Joined:
    Apr 18, 2015
    Posts:
    45
    First of all thanks for this great tutorial! This really helped me much to get easily into Unity. I started from scratch in Unity 5.0.1 Personal and I haven't had any bigger issues. Just minor problems with Fog, lights baking etc but this is something I can definitely live without. The scene lighting is still nice and other stuff just work fine.
    I also vote for not to remove this great tutorial as it's value is still considerably high and it doesn't matter much if some part doesn't work perfectly in Unity 5. With a little help of the great Unity documentation a solution can be usually found.

    But stop talking about well known facts :). I'd like to also bring some value here to the forum.
    I'd like to disscuss the universal script for single door a little bit.
    IMO the script looks good from the basic perspective but it might be improvet a bit.
    I see the following problem with door interaction (colliders) counts:
    - in case key is required and player hits the door sphere trigger collider, no count is added. But in case player leaves the door trigger collider, count is decremented which is not correct. In case enem(y)/(ies) are nerby (hitting the door trigger collider) and player approaches to the door and then leaves (he can also repeat this process a couple of time), the door will be closed as count gets to zero (and enemies get squashed (in ideal case ;) ) inside the door).

    Possible solutions:
    - to decrement count by player only in case player has key (in case door requires key). Not ideal solution in the real life. I guess the door shouldn't be closed in case enemy opens the door, player enters door (as it's open) and enemy leaves (I know it won't leave but shoot player instead ;) ).
    - to create bool playerIncrementedDoorCount variable. In case key is required and player doesn't have key, this variable would be true only in case door is first open by enemy and player hits door trigger collider before door close transition is completed.
    Then in OnTriggerExit we might check the bool variable and decrement door count based on this.
    - to check whether player or enemy is not colliding in OnTriggerStay in case door count is zero.

    It can be easily tested by putting non moving enemis in front of the door and then move them manually and also move player manually.
     
  24. kubajs

    kubajs

    Joined:
    Apr 18, 2015
    Posts:
    45
    I'm planning to attach script later, hopefully today, working on that now.
     
  25. kubajs

    kubajs

    Joined:
    Apr 18, 2015
    Posts:
    45
    As promised here is the fixed universal door script.
    Description directly in code in OnTriggerStay method.
    Basically the door should behave like real world automatic door.
    If somebody with key card enters door zone, it's opened but it cannot close until the last object leaves the door trigger zone.
    Also I play access denied clip at position instead of switching AudioSource clip.

    To test just put 1 or 2 enemy clones + player to the following position:
    char_ethan: -1.35, 0, 8.18
    char_robotGuard: -0.75, 0, 7.331
    char_robotGuard 1: -1.652, 0, 6.781
    run scene and manually reposition the 3 objects in scene view.
    I kept the Debug.Log on to display _count variable.
     

    Attached Files:

  26. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,614
    When I originally followed this tutorial chapter 4 wasn't out. I upgraded my project to Unity 5 and did chapter 4 last night. No problems whatsoever. The only minor issues were some UI differences between Unity 5 and 4 and some obsolete functions the console told me how to fix.

    My project is however quite different from the official one as I've extended it quite a bit and changed quite a few things. I'll upload my project when I'm done with it for people to look at. This is an excellent tutorial for learning some Mecanim tricks. I learned a ton from Chapter 4.

    @Adam Buckner I feel you're already removing too much from the learn/tutorial section. There are quite a few old tutorials I'd like to see there still. Like the first person shooter one, the 2.5d platformer or the 3d platformer (the Lerpz tutorials). Just put up huge disclaimers and leave them up in my opinion. The assets are neat and there are some cool tricks in them still. It's a shame you have to remember to make an offline copy of the tutorials in case they get removed from the official site.
     
  27. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    321
    Hello guys,

    I won't bore you with all the details of what I'm doing, it's suffice to say that I'm using the Stealth tutorial 406 to add enemy shooting to my project.

    Now when the player gets close to the enemy, within 15 metres - I'm not following the tutorial exactly as I don't really understand most of it - the robot goes into the shooting animation. All good so far, and then a script that is supposed to grab the value of the animation curve of the Shot parameter in the Shooting animation and signal a value greater than zero to create the "laser' effect. However the script only ever returns a zero and can't figure out why.

    And I am really hoping that you guys could tell me what is wrong with the code.

    The script is below it's really straightforward, but, I can't figure out why its not working:

    Code (JavaScript):
    1. #pragma strict
    2.  
    3. //shooting script unlikely to work
    4. //    var unlikely: boolean = true;
    5.  
    6. public var shotClip:        AudioClip;
    7. public var flashIntensity:    float = 10f;
    8. public var fadeSpeed:        float = 10f;
    9.  
    10. private var anime:            Animator;
    11. private var laserShotLine:    LineRenderer;
    12. private var laserShotLight:    Light;
    13. private var isShooting:        boolean;
    14.  
    15. var player:                 Transform;
    16.  
    17. function Awake(){
    18.     anime = GetComponent(Animator);
    19.     laserShotLine = GetComponentInChildren(LineRenderer);
    20.     laserShotLight = laserShotLine.gameObject.GetComponent.<Light>();
    21.  
    22.     laserShotLine.enabled = false;
    23.     laserShotLight.intensity = 50f;
    24.     }//end Awake()
    25.  
    26.  
    27. function Start () {
    28.     }//end Start()
    29.  
    30. function Update () {
    31.     var shot: float;
    32.     shot  = anime.GetFloat("Shot");
    33.  
    34.     //print("shot: "+ shot);
    35.     if(shot > 0.5){
    36.         print("Success!!!!!!!!!!!!!!!!!!!!!!!!");
    37.         }//end if
    38.     }//end Update()
    39.  
     
    Last edited: May 4, 2015
  28. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,614
    If you download the tutorial assets there's a done folder in there with the completed projected. You could look in there to see how they do it if you're not able to follow the tutorial yourself.

    From looking at your script are you ever playing the Shot animation? It looks to me like you're trying to read the value from an animation you're not playing.
     
  29. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    321
    Thankyou for replying :).

    Ok, the enemy is moving through the different waypoints that I have set, the navmesh agent is also set so the models go around objects as they are supposed to, and when the "player" approaches them they do actually go into the shooting animation with the arm outstretched - with the recoil - so does that give you any ideas as to what is going on?

    IIRC, movement and shooting are basically in different scripts. Most of the movement stuff is covered by tutorial 402 and 407 in an "Enemy AI" script and shooting is covered by tutorial 406 in the "shooting" script.
     
    Last edited: May 4, 2015
  30. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,614
    I'm currently working on this project myself so I'll have a looksy.

    I would still recommend that you download the project assets and compare your project to the done-version in the tutorial assets. The entire project is on the asset store. Especially considering you've said that you're not following the tutorial exactly. Not easy for us to know what else may be different or wrong in your project by just looking at this one script.

    My version is also very different from the tutorial, but I have the completed tutorial in a separate project so I can look at it if something I've done doesn't work correctly.
     
  31. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,614
    It's hard to say really. I tried renaming my parameter in the animator and then I got a warning. So that's not your problem unless you are getting a warning.

    But have you made sure there actually is a curve on your shooting animation?
     
    Last edited: May 4, 2015
  32. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,614
    What I don't understand is the relation between the curve and the parameter. It seems like this doesn't work at all if you don't create a parameter or it hasn't got the same name as the curve. Is this just automatic? There's no place in the project that we actually feed the value from the curve to the parameter. Normally you feed information to the parameters and in turn drive your state tree, but here the parameter gets its information magically if you've named them the same. Any solution that relies on your naming things identically multiple seemingly unrelated places feels like a convoluted solution to me.

    I would much rather prefer it if we had to read the curve from the animation ourself. That way we wouldn't need to define "Shot" and "AimWeight" as parameters in the animator either. After all we know we already know we're playing the shooting animation.

    But I feel like a lot of the solutions presented in this tutorial offers very little control and I probably wouldn't use them myself. I feel like animation should never drive gameplay, it should just be an effect of gameplay. Or something like that. Not sure how to word it. :p You should say in the code "Shoot()" and then play the recoil animation. In this tutorial it's completely opposite.
     
    Last edited: May 4, 2015
  33. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    321
    I don't either - and I don't understand how the AimWeight works in "raise" and "lower" animations as this value is never used in any of the code.

    As you also say a lot of of solutions are ones that I would never use, and don't allow you to test out certain sections before running the code as a whole - which I think is essential to learning. Which I why I set little goals as I went along, such as getting the models to move, then settings waypoints and getting models to move between them, setting the NavMesh agent so the objects don't magically walk through stuff (even though it was funny), getting the models to recognise the "player" being in range ... now shooting.

    I wish there was some way of setting the value of "Shot" in the animation itself a bit like a keyframe - like at this point in the animation set Shot to 1, then at another back to zero, and be able to access that.

    Anyway, others have reported that everything works fine so I'm obviously doing something wrong.
     
  34. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,614
    That part I think I do understand, in fact I think I understand all of it now.

    You have this bit in the EnemyShooting script for the AimWeight:
    Code (csharp):
    1. void OnAnimatorIK(int layerIndex) {
    2.     // Cache the current value of the AimWeight curve.
    3.     float aimWeight = anim.GetFloat(hash.aimWeightFloat);
    4.  
    5.     // Set the IK position of the right hand to the player's centre.
    6.     anim.SetIKPosition(AvatarIKGoal.RightHand, player.position + Vector3.up * 1.5f);
    7.  
    8.     // Set the weight of the IK compared to animation to that of the curve.
    9.     anim.SetIKPositionWeight(AvatarIKGoal.RightHand, aimWeight);
    10. }
    I think OnAnimatorIK() is called every frame like Update() on objects which has an animator component on them and have a layer with the IK Pass toggle enabled. In our case the Shooting layer on the guard's animator controller has the IK Pass toggle enabled.

    In the raise animation AimWeight has a curve which goes from 0 to 1, in the shooting animation AimWeight is always 1 and in the lower animation AimWeight goes from 1 to 0. This makes the enemy point his arm at you based on the above code in OnAnimatorIK().

    In the EnemyAnimation script the Shooting layer is set to full weight:
    Code (csharp):
    1. // Set the weights for the shooting and gun layers to 1.
    2. anim.SetLayerWeight(1, 1f);
    3. anim.SetLayerWeight(2, 1f);
    This would make it take control over the entire character if it wasn't for the avatar mask which tells it to only animate the arm. It also doesn't do anything until the guard actually sees the player because the default state for that layer is empty and the raise animation state is only triggered by when the PlayerInSight parameter is true which we actually do control through script and not curves (thank god :p).

    When the guard sees the player it goes through all the states in the Shooting layer one by one depending on the conditions met.

    The worst part about this is that it's impossible to google for "animation curves" as that's a completely different thing. So it's unnecessarily hard to find info about these curves that you define on your animations. I think they're a replacement for the old animation events. I honestly think his mention of them about 1 minute into this video is the best we get: https://unity3d.com/learn/tutorials/projects/stealth/enemy-animator-controller

    I still think this is horrible design. It's one of those "it just works" parts where I would very much prefer it to require a bit more code to work. From my understanding if you name a parameter in your animator controller the same as a curve defined on the animation (either by accident or on purpose) it will automatically read the value from that curve. I have no idea what'll happen if you at the same time try to feed a value to the parameter through script like you normally would.

    And I'm sorry to say I still have no idea why your Shot float never goes above 0. I think you've skipped an essential step somewhere. :)

    I also very much agree with you about the style of some of these tutorials. I'm guessing it's a lot faster to make tutorials like these, but they're basically just breakdowns of the project in question. You have entire sections where you're just writing down what's being written in the video with no clue what the end result will be. I feel like they are not very much suited for beginners and more experienced Unity users would just download the finished project and go through it at their own pace and pick the parts they're interested in.

    A tutorial approach where you write the code for running forward, showing the result, write the code for going sideways, showing the result, tweak the code a bit, show the result etc. is a much better approach to video tutorials in my opinion. But it would also probably mean 40 minute videos instead of 10 minute videos.
     
    Last edited: May 5, 2015
  35. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    321
    Thanks for the explanation on AnimatorIK and the use of the AimWeight it's starting to click together now - only slowly though, I'm absolutely exhausted from the 2 previous nights of martial arts and more to come this week, when I finally get a break and get to think about it will be a lot clearer :).

    I think you are right - I did numerous searches for animation curves and the results were for "animations" using graphics primitives and not mecanim related. That one minute video was the only one I found on that was on mecanim curves and events!!!


    I'm getting onto that - I followed your advice and downloaded the "whole" Stealth package including the done scripts and scenes - previous to that i only downloaded the needed models - I did that before I went to bed last night, I already have a couple of ideas. Thank goodness they have the "done" files in that package.


    I choose to live in hope :p. If I ever get competent at this stuff - I would like to do tutorials very much in the manner you described - it's the getting competent part that's the problem :D.

    Thanks for all the help :cool:.

    Warmest Regards,
    CK.
     
  36. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,671
    Sadly, I don't have control over the final content on the Learn site. I can make my opinion known, and occasionally have been know to become argumentative over a point here or there, but that final decision is not down to me.

    I have saved all of these tutorials in my personal collection. I have them in dropbox somewhere; the v1.x FPS pdf, the Lerpz tutorials, Penelope, etc..

    Making them available? It's such a double edged sword.

    For example, we have maintained the availability of a version 3.x Car Tutorial, for which we were recently and deeply criticized, as it didn't "work right out of the box" and was "riddled with errors when imported in Unity 5", etc.. When we spoke with the people involved they felt very strongly that these projects either need to be maintained or removed.

    In many cases, maintaining them is not possible, so - at least according to their opinion - the only other option is to remove them.

    As you can see, these decisions always put us in a bind, and it's difficult to please everyone all the time.

    We still do have some seriously venerable projects available. Penelope, AngryBots, and even StarTrooper are still available, as well as the Car Tutorial linked above.

    Now, in my humble opinion, if I'm going to spend a large chunk of time upgrading an old project (which I just did with Roll-a-ball), especially one that may have a number of deep issues due to age, I would rather spend that time creating a new fully functional and polished project designed from the ground up for the newest version of Unity which directly addresses the the learning needs of that version.

    Perhaps we can find a way to distribute some of these older projects, or at least their assets, but I'm not sure the best way to accomplish this.
     
  37. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,671
    Not trying to be a "Cat amongst the pidgeons", but - there are some games that build in the animation playing into the game play. Probably both as an intent to control the game play and to solve the problems of playing complex animations during game play.

    Guild Wars 2 comes to mind, as I'm playing it. There, the skill animations are timed to the skill itself. Some have additional mechanics, like cooldowns, after the animation stops playing, preventing re-using the skill, even if the animation is done. This has an interesting effect on game play. The character makes a move and is committed to it. There are certain skills, with their animations, that can lead to other players predicting the opponent's move (either NPC or PC), which can lead to more life-like game play. A skill that requires a long "back cast" or prep time can be telegraphed to the opponent, so needs to be carefully handled. Players and their opponents can't interrupt their own animation in many/most cases, and need to let the skill and it's animation play out before using another skill.

    Now, this won't be that great in say, PvP death match with guns like Day of Defeat or Counter Strike, unless the animations are very short.

    I guess, tldr; is just saying that having animations drive the game play is not necessarily a bad paradigm if you build your game around it.
     
  38. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,671
    Have you looked into "Animation Events"?
    http://docs.unity3d.com/Manual/animeditor-AnimationEvents.html
     
  39. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,671
    This was one of the first official tutorials from the Learn site, which was made when I was doing nothing but the live training sessions, and I do believe it fell a little out of scope. It is an intermediate tutorial, but yes, it's more of a description or explanation rather than a learning tutorial in many cases. There is a lot to learn from it, but it's not as granular as it could be.

    But I think you've identified the issue. For a project of this scope, it would take even longer to cover if done in a step by step manner, and it's already very long as it is.

    I'm glad you're making headway! (We won't delete this project just yet...)
     
  40. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,614
    Yeah, I realized that was a very subjective opinion after I wrote it. In nearly every third person game like Bloodborne, Dark Souls etc. you have to wait for animations to finish before you can take your next action. Which is precisely why I can't play those games. I feel like I'm not in control. But they are obviously very popular games. I can accept it in a game like GTA 5, but not in a game like Dark Souls where one wrong move gets you killed. If I feel it was the game that killed me and not my own actions I instantly rage quit. :p

    Please never do. :) Just the assets themselves in this tutorial are worth keeping up forever in my opinion. They are so modular you can make practically any game you want with them. And they are way higher quality than what would be needed for a top down game like Stealth. I'm still fiddling about with this project and my game looks very different from the tutorial game. I'm using the 5.x standard assets third person character with a GTA 5 style camera, I've added a hacking mini game, I've fitted roofs to the buildings and upgraded all the materials to the standard shader, all using the included assets. It would be a shame if the project was ever removed in my opinion. As a pure hobby game developer (at least for now) producing assets is the one thing I'm not keen on doing. So having tutorial projects to dissect, no matter how old, is always welcome. For example I still remember the old first person shooter tutorial and I would love to be able to create something out of those assets. The same with the Lerpz tutorials. I didn't backup any of them while they were available. In fact I was looking for the 2D Lerpz tutorial when I was doing my Ludum Dare game. :D

    I have experience with supporting old stuff from work and I know how much effort it takes, but I still think you should do it. I think if it was just made clear to people that these are legacy projects then they can only blame themselves if they download them and they don't work. And you can ignore their support requests and criticism with a clear conscience.

    Currently on both the stealth project and the car project on the asset store what's written in bold is:

    Requires Unity 4.2.1 or higher.
    Requires Unity 3.3.0 or higher.

    And then further into the description there's a mention of them not being suited for Unity 5.x. So in my opinion it's confusing for newcomers. You could easily download these projects today and expect them to work in Unity 5.x.

    I would consider having a "legacy" section in the asset store as well as in the learn section of this site with very visible disclaimers. So anyone going there is doing so fully aware of the fact that they will have upgrade the project themselves if they are going to use it in a newer version of Unity, and it may break horribly. And if there are "official" support threads like this one they can also be mentioned in the project description. Otherwise they can just search the forums and/or make a thread asking for help with the project and perhaps someone else has already upgraded it to their version of Unity for them. If all else fails I'm sure some kind soul on these forums will help them without the need for Unity themselves to take any action. :)
     
    Last edited: May 6, 2015
    CelticKnight likes this.
  41. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    321
    I'm sorry, but, I have to say this:
    • don't delete this project ever.

    While I have had numerous problems with the tutorial and modifying it greatly to fit into my humble FPS project - I didn't even bother looking at the first three chapters - there is nothing else available on using mecanim enemies in a first or third person perspective - and I've looked for them - literally nothing. No websites, YouTube tutorials, print materials, copy-righted materials (eg books, assets), cover this subject.

    So while I think the way this material is not presented in a way in which I would do it - it's ALL that there is and because of that needs to stay.

    Regards,
    CK.
     
    Last edited: May 7, 2015
  42. RavenLiquid

    RavenLiquid

    Joined:
    May 5, 2015
    Posts:
    29
    I'm currently nearing the end of the first chapter and so far I concur that it would be a good idea to keep it.

    I did the survival shooter and rollerball tutorial (yes, in that order) before this, and until now I'm doing pretty well. The knowledge gained in those previous tutorials have kept me going and working around most issues. The only big obstacles until know are the lighting because they have moved to different settings/windows. Usually searching for the settings will either result in a patch note mentioning the removal of set settings, or a forum post (like this).

    This tutorial teaches some things not in the other tutorials, but also gives one the option to test what they learned in previous tutorials. Take the UI for example, this is completely new and the tutorial still guides you through the old one. Having learned how to do it in the other tutorials I found it easy to adapt it to the new one.
    The same goes for outdated scripting like having direct access to certain components on the game object that has been deprecated. I could use the GetComponent way and also improve upon the code by increasing the scope in some scripts.
    It probably helps that I'm a software developer by trade, so the scripting makes sense more quickly.

    But the main reason stays, this has been really helpful so far and I feel like I'm adding instead of copying what is said.
    It is a bit difficult to follow at times because the video goes quite fast, causing me to not be able to keep up with typing and having to pause the video constantly to see what it is that I'm doing. This is sometimes not explained very well. But also this is an opportunity to learn. Look at what you make does, and try to understand why.

    I did stumble upon one question, why does mecanim have no support for wrap modes in animation clips? For the CCTV rotation, the ping pong loop is easily substituted with the addition of a keyframe at 240 and an Y rotation of 0. But it sounds like something usefull if you have more complicated animations.
     
  43. Mr B

    Mr B

    Joined:
    May 5, 2015
    Posts:
    3
    I would like very much the removal of out of date content (throws and misses two feet away). But then, I would like very much *at least* one more unity 5 tutorial game. It would have to be a game that teaches all "buttons", and areas, and "tricks" of U5. That way, that would be the only one we need. I know it is a giant project, but hey, the night is young and ,so is U5.
    Oh and almost forgot. When I encounter this type of issues, usually 90% of the times I fight to fix it. The other 10% of the time you just have to ask the question: Is it a want or a need? What I mean is, is it making my game unplayable, or can I omit that (or substitute it) and get on with my learning? Fog I can live without, cctv on the other side... And this is precisely my point in the removal and substitution of this tutorial, so it easier, more enjoyable to learn. In other words, please do not remove this project until you have a substitute for it. I just thought this thread would be a good place to ask for a new U5 tutorial.
     
    Last edited: May 9, 2015
  44. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    321
    The removal of this tutorial does not guarantee that a new tutorial would follow, nor would it guarantee that it would follow the same premise - that of incorporating enemies using mecanim, which I have outlined above does not seem to exist.

    So since there is nothing to replace this tutorial it needs to stay, up and to the time that a new Unity 5 tutorial covering the exact same topics is placed in the tutorial section.

    And, by the way, I intend to do a course in Unity later this year - so having a tutorial like this is not a want - it's a need.
     
    Last edited: May 12, 2015
    Mr B likes this.
  45. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,614
    Is it possible to see when a function was added to Unity?

    I currently have to call this function to make my guards chase me after they have stopped:
    http://docs.unity3d.com/ScriptReference/NavMeshAgent.Resume.html

    But this function is not called anywhere in the original code. In the original code this is all there is:
    Code (csharp):
    1. void Shooting ()
    2.     {
    3.         // Stop the enemy where it is.
    4.         nav.Stop();
    5.     }
    There is no call to Resume() anywhere from what I can tell, but without it my game flat out won't work in Unity 5. Was Resume() added in Unity 5? Or was it just not needed in Unity 4?

    Without it my nav agent returns that it has a path and it has a destination, but it's desired velocity is 0 so it refuses to go to that destination. If I put nav.Resume() in the patrol and chase states everything works.

    Edit: I downloaded Unity 4 and imported the project fresh from the asset store. Resume() is not mentioned yet it works like it should. Was this a bug in Unity 4? Is it a bug in Unity 5? Or is it just a change? Anyone else working with this project in Unity 5 also seeing the same thing?
     
    Last edited: May 11, 2015
  46. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    321
    Yep, I noticed the same thing, and it took a while to figure out how to get the "agent" moving again in Unity5. So, I just assumed it was a Unity 5 thing, and found the function when searching on the docs for NavMeshAgent.

    I just went and found this on the What's New in Unity 5.0 document:
    • "Setting destination on a NavMeshAgent doesn't resume the agent after calling Stop; call Resume explicitly to resume the agent".
    So, it looks like an addition for Unity5!
     
    Last edited: May 13, 2015
  47. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,614
    Thanks, I just googled the quote you pasted here and found the same thing. Spent an hour or two trying to figure out what was wrong last night.

    I feel like Unity is still lacking so much in a lot of areas. The API should mention this explicitly. The best, quickest and most useful change they could do in my opinion is to allow us to comment on the API and/or manual. Then we could fill in all the blanks ourself. Give examples in the comments, or in this case write a disclaimer about how this actually works now in Unity 5.

    The 3 other API's I normally use are PHP, Drupal and jQuery and I find them to be so much better than Unity's API, sadly.
     
    CelticKnight likes this.
  48. RavenLiquid

    RavenLiquid

    Joined:
    May 5, 2015
    Posts:
    29
    I agree about a comment section in the API. I also liked it when MS had one for the .net reference. A lot of times usefull comments or examples would be posted there.
     
  49. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,671
    T
    There is an API history page ... Somewhere ... I'll see if u can find it. Ping me if I've forgotten, and you haven't found it using Google, or whatever.
     
    kubajs likes this.
  50. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    321
    Hello Guys,

    I am having a couple of problems following the code presented in the Stealth tutorial. It is presented in the tutorial on "Sight and Hearing" in tut 403.

    The problems occur with the OnTriggerStay() function. I haven't copied the code exactly as I am trying to 'learn' and to aid that I am picking out pieces of the code, implementing it and commenting it and using print for debugging purposes to help aid the process.

    So, the first problem revolves around this code and the result of this code:

    Code (JavaScript):
    1. if (other.gameObject.tag == "Player"){
    2.    print("Player is in Robocop's 'sphere' of influence...");
    3.    var direction: Vector3 = other.transform.position - transform.position;
    4.    var angle1: float = Vector3.Angle(direction, transform.forward);
    5.    //print("Angle1: "+angle1);
    6.    if(angle < 110 * .5f){
    7.      print("We can 'see' the player");
    8.      //Can't do anything though!?! the Raycast handles whether
    9.      //we can shoot the player
    10.      ...
    11.      ...
    12.      }
    13.    }
    I am having trouble understanding why we need this code at all. It doesn't really seem to add anything of value. The code that determines whether we can actually do anything to the player, ie, shoot them, is if the ray hits the player which comes up next in the code. So what am I missing here?

    Next problem the code as it stand in the tutorial concerns this line:

    Code (JavaScript):
    1. if (Physics.Raycast (transform.position+transform.up, transform.normalized,hit, 10f)
    This does seem to not work at all! I can place the character directly in the line of the Raycast (using debug.drawray in the scene window) and the code will not pick up that the character is being hit. So I changed the line to:

    Code (JavaScript):
    1. if (Physics.Raycast (transform.position+Vector3(0,1,0), transform.forward,hit, 10f))
    And at least it seem to work properly - well I "think" it works - but, of course I could be doing something wrong!?! So am I doing something wrong?

    Now the following code will not pick up the player "unless" the ray passes directly through the player, so, I can be right next to Robocop and because the ray is travelling in a directly straight line as Robocop is travelling in a straight line between waypoints, it will not pass through the player and therefore not pick him up. So, in essence, I can have clear line of sight to Robocop, within the 5 metres and Robocop will be completely oblivious. So what am I doing wrong here?

    Code (JavaScript):
    1. Debug.DrawRay (transform.position+Vector3(0,1,0), transform.forward * 10f, Color.red);
    2.    if (Physics.Raycast (transform.position+Vector3(0,1,0), transform.forward,hit, 10f))
    3.      if(hit.collider.gameObject.tag == "Player"){
    4.        print("Player 'can' be shot...............");
    5.        }
    6.      }//end physics if
    Any help with this is greatly, greatly, appreciated.

    Thankyou and Regards,
    CK.
     
    Last edited: May 17, 2015