Search Unity

Official John Lemon’s Haunted Jaunt: 3d Beginner Official Thread

Discussion in 'Community Learning & Teaching' started by Woolley_Kat, Apr 15, 2019.

  1. ckruss

    ckruss

    Joined:
    May 16, 2019
    Posts:
    1
    This tutorial series is great. There are a couple of small things I've noticed so far though.
    I did the tutorial out of order and did the camera stuff prior to environment, and I think that created a great experience since I was able to check out my progress step by step (when improving the environment) from game mode.

    The other is that code stuff seems a bit demographic confused. You're not going to teach somebody any meaningful amount about coding in a few paragraphs so I think it'd probably make more sense to just set knowledge of coding as a prerequisite. There are countless great sources to learn C#. The reason I mention this is that it there's a lot of stuff that a reader should not be expected to know about Unity/etc tucked in between things like the tutorial trying to explain dynamic vs static methods in a few paragraphs. You end up not really informing your readers who don't know how to code and putting in lots of not so useful information for your readers who do know.

    Just little nit picks, because this has overall been fantastic. Great pacing, great writing, and highly informative.
     
    lchen0329 likes this.
  2. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Does this tutorial make use of the "Game Kits". I am looking for both beginner and intermediate 2D and 3D tutorials that are 'old school' and DO NOT make use of the 2D and 3D Game Kits. I want to learn everything from scratch.
     
    Tigersong likes this.
  3. dedalot

    dedalot

    Joined:
    May 22, 2019
    Posts:
    2
    Hello.
    Relative beginner to coding and totally new to Unity. I am on Enemies Part 1 static observers.

    upload_2019-5-24_10-33-47.png

    I have ( I believe) verified my scripts to closely match the example.

    I have the gargoyle prefab in position and saved but my inspector does not show a location to drop the JohnLemon GameObject.....

    upload_2019-5-24_10-36-5.png

    I am guessing I am missing something small.

    Here is my Observer script as it is now.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class Observer : MonoBehaviour
    6. {
    7.     public Transform player;
    8.     public GameEnding gameEnding;
    9.  
    10.     bool m_isPlayerInRange;
    11.    
    12.     void OnTriggerEnter (Collider other)
    13.     {
    14.         if (other.transform == player)
    15.         {
    16.             m_IsPlayerInRange = true;
    17.         }
    18.  
    19.  
    20.     }
    21.     void OnTriggerExit(Collider other)
    22.     {
    23.         if (other.transform == player)
    24.         {
    25.             m_IsPlayerInRange = false;
    26.         }
    27.  
    28.  
    29.     }
    30.  
    31.     void Update()
    32.     {
    33.         if (m_IsPlayerInRange)
    34.         {
    35.  
    36.             //This code creates a new Vector3 called direction.
    37.             //From vector math, we know that a vector from A to B is B - A.
    38.             //This means that the direction from the PointOfView GameObject
    39.             //to JohnLemon is JohnLemon’s position minus the PointOfView
    40.             //GameObject’s position.
    41.  
    42.             Vector3 direction = player.position - transform.position + Vector3.up;
    43.            
    44. // that created a direction. This creates a ray and tells it
    45.             // to aim in that direction
    46.  
    47.             Ray ray = new Ray(transform.position, direction);
    48.             RaycastHit raycastHit;
    49.             if (Physics.Raycast(ray, out raycastHit))
    50.             {
    51.                 if (raycastHit.collider.transform == player)
    52.                 {
    53.                     gameEnding.CaughtPlayer();
    54.                 }
    55.             }
    56.         }
    57.     }
    58.  
    59. }
    60.  


    Any help appreciated. Thank you very much.
     
  4. dedalot

    dedalot

    Joined:
    May 22, 2019
    Posts:
    2
    WOOOhoooo I found it.

    m_IsPlayerInRange

    missed a camelCase my bad
     
  5. osmanzort

    osmanzort

    Joined:
    May 22, 2019
    Posts:
    21
    Hello, I'm using Unity 2019.1.3f1 and can't make the triggers work. Am I doing something wrong or is the project incompatible with this version?

    Edit: Nevermind, there are two Game Objects with the name "JohnLemon" and apparently I put the collider component on the wrong one.
     
    Last edited: May 24, 2019
  6. bishopda1985

    bishopda1985

    Joined:
    May 25, 2019
    Posts:
    1
    I'm having difficulty with the Ghosts and Waypoint Patrol. I double checked my code and it is exactly the same as the tutorial. I double checked the parameters on the nav mesh agent and the positioning of the waypoints. The ghost in the first room just heads to the left and runs into the wall. The others follow a path that might be close to the plan, but it isn't right. Any tips?
     
  7. piloverspies

    piloverspies

    Joined:
    May 25, 2019
    Posts:
    1
    Hi,
    I've just finished part 2 of the character movement, but when I went to test it, my character would move forward then revert back to its original position. This happened any time the walk animation was initiated. Can anyone tell me anywhere the error could be? I copied and pasted the final player movement script, and it still didn't work.
     
  8. mronursari

    mronursari

    Joined:
    May 26, 2019
    Posts:
    1
    Hello,

    First of all, I want to say thank you very much for this great tutorial. I have completed it from start to end, and with 0 previous knowledge in unity now I feel like I already have a good grasp.

    I have a minor problem that I cannot seem to fix, for some reason only one of my ghosts are actually making sound, and others are still quiet. I made sure that I edited the Prefab, not the instance, when adding the audio component, and the component is still visible in my quiet ghosts as well, only they do not make any sound at all. Below is the ghost that actually makes sound, and ghost(1) which is quiet. Any ideas on a fix?

    loudghost.PNG

    Here is the noiseless ghost:
    quietghost.PNG
     
  9. EastanITF

    EastanITF

    Joined:
    Jun 14, 2016
    Posts:
    2
    Hey, I'm currently on step 3 of part 5 (the camera) and I can't seem to find anything resembling "Cinemachine". Here's what it tells me to do:


    cinemachine.PNG

    Here's where I assume the "top menu" is:

    cinemachine2.PNG

    Anyone have a better explanation, or am I just missing something simple?
     
    gman435 likes this.
  10. dbchest

    dbchest

    Joined:
    Sep 26, 2016
    Posts:
    23
    I completed John Lemon's tutorial this afternoon and I felt the desire to stop by the forum and express my gratitude to all of individuals involved in bringing this tutorial to the community! John Lemon's is one of the best, if not the best text-based tutorial I have ever completed; being text-based, I feel as though it was more engaging and I seemed to retain much more information having to perform each step personally in order to see the results (something often lost in translation with video tutorials), and the in-depth explanations to every single step of the process was key to finally putting all of those pieces of the puzzle into place! I have no doubt that the experience I gained from completing this tutorial has taken me to place where I will feel more confident than ever in reaching my personal goals.

    Wonderful work! I would be excited to see a follow up project very much like John Lemon's that continues to demystify some of the more intermediary concepts to working with 3d in unity!

    Derek
     
    brizguy and Randomfield21 like this.
  11. UltimateCodeWarrior

    UltimateCodeWarrior

    Joined:
    May 28, 2019
    Posts:
    8
     
  12. UltimateCodeWarrior

    UltimateCodeWarrior

    Joined:
    May 28, 2019
    Posts:
    8
    Thx! I followed the Tutorial, got to the bitter end and the character still didn't walk. You would think that someone would have thought put in a way to control the character. There should be a short video showing what to expect initially and what to expect when you are done. Not just have the learner download a pile and not know what to expect. That's a real lousy experience.
     
  13. porpoise-kk

    porpoise-kk

    Joined:
    May 30, 2019
    Posts:
    4
    Did you set the alpha to be 0?
    FaderCanvas -> EitImageBackground's inspector, the Canvas group component, alpha should be 0.
     
  14. porpoise-kk

    porpoise-kk

    Joined:
    May 30, 2019
    Posts:
    4
    Hi,

    I'm running into the problem that the game didn't exit. There's no error warning. Does anyone have any idea why is that?
     
  15. dbchest

    dbchest

    Joined:
    Sep 26, 2016
    Posts:
    23
    learning how to move the character IS part of this tutorial (lesson 3: Player character part 2 to be exact), so if your character does not move then you made an error somewhere along the way and I suggest you review that section of the tutorial and compare your code to the instructions.

    did this problem occur in your final build of the tutorial? the Application.quit() function only works within a build; this line of code will not end gameplay within the editor via play testing.
     
  16. Spunalien

    Spunalien

    Joined:
    May 30, 2019
    Posts:
    3

    I am having the same problem - did you ever get a solution?
     
  17. Spunalien

    Spunalien

    Joined:
    May 30, 2019
    Posts:
    3
    I just downloaded the Completed Tutorial to try and see where I went wrong with my "missing animator" problem. When I tried to play the completed tutorial I got the message (like) 2 audio listeners try to have a maximum of one - and it wouldn't run.
     
  18. Dudey

    Dudey

    Joined:
    May 28, 2019
    Posts:
    3
    You may have accidentally attached the script component to the child GameObject JohnLemon, which just has a Skinned Mesh Renderer component and no Animator component. This would then give you the error as the script is trying to access the Animator component on a GameObject that just renders the skin.
     
  19. Dudey

    Dudey

    Joined:
    May 28, 2019
    Posts:
    3
    You may have accidentally attached the script component to the child GameObject JohnLemon, which just has a Skinned Mesh Renderer component and no Animator component. This would then give you the error as the script is trying to access the Animator component on a GameObject that just renders the skin.
     
  20. porpoise-kk

    porpoise-kk

    Joined:
    May 30, 2019
    Posts:
    4
    I encountered this before build. For example, when the player hits the game ending object, which is the cube that I put at the exit, I was expecting to see the fading "you won" message, but I didn't see it. When the player gets detected by the gargoyle, I also didn't see the "caught" message.
     
  21. porpoise-kk

    porpoise-kk

    Joined:
    May 30, 2019
    Posts:
    4
    Never mind. I think I have the wrong reference to the player. There are two johnLemon and I referenced the wrong one, so the trigger never detected him.
     
  22. Spunalien

    Spunalien

    Joined:
    May 30, 2019
    Posts:
    3
    Thanks, I restarted and apparently avoided what ever mistake I made the first time. I still have the other "wrong" file and will play with it to see if I can fix it.
     
  23. pvoskuil

    pvoskuil

    Joined:
    Jun 1, 2019
    Posts:
    1

    I ran into the same problem. It turns out that when I *thought* that I'd added the Player Movement Script to the top level JohnLemon prefab, I'd actually added it to the JohnLemon that is one level down in the hierarchy. I'm not sure how it got selected (I suspect that it toggles between the parent and child when you click on the character in the scene window).
    In any case... Make sure that the Rigidbody, Capsule Collider, Animator, and Player Movement (Script) are ALL components of the TOP LEVEL prefab.
     
  24. Benjijtaj

    Benjijtaj

    Joined:
    Jun 1, 2019
    Posts:
    2
    I'm having a problem on Enemies Part 2 Dynamic Observers, I have set all the things like nav mesh waypoints and speed, but the ghosts won't move
     
  25. Benjijtaj

    Benjijtaj

    Joined:
    Jun 1, 2019
    Posts:
    2
    Nevermind I fixed it
     
  26. tannerralph_unity

    tannerralph_unity

    Joined:
    Jun 4, 2019
    Posts:
    6
    I'm working on
    The Player Character: Part 1.
    When I click on play, I get this compiler error.
    compiler errors.png
    Any suggestions would be appreciated.
     
  27. tannerralph_unity

    tannerralph_unity

    Joined:
    Jun 4, 2019
    Posts:
    6
    The message at the bottom is:
    compiler errors 2.PNG
     
  28. tannerralph_unity

    tannerralph_unity

    Joined:
    Jun 4, 2019
    Posts:
    6
    I'm guessing the errors have something to do with this error that I get when I try to re-open the project.
    Unity Package Manager Error.PNG
     
  29. tannerralph_unity

    tannerralph_unity

    Joined:
    Jun 4, 2019
    Posts:
    6
    Any suggestions would be welcomed.
     
  30. JacekMackiewicz

    JacekMackiewicz

    Unity Technologies

    Joined:
    Jul 5, 2017
    Posts:
    34
    Hi Tannerralph_Unity,
    This issue usually arises if the project has been opened with one version of Unity and then reopened with a different version. (Though it can also occur if initially the project was opened using an unsupported Unity version too - please make sure you're using Unity version 2019.1 for best results.)

    To fix this issue you can try resetting the packages to their default. At the top Unity menu select Help > Reset Packages to defaults. Alternatively you could try a Reimport of the project by right clicking the Assets folder within the Project Browser and selecting Reimport All.
    Good luck!


    Hi EastanITF,
    Sorry to hear you're having this issue! If the Cinemachine top menu is missing that means there's a problem with the Cinemachine package. Is your package manager throwing any issues? It's possible that Cinemachine got accidentally removed from your project - if you open the Package Manager window by going to Window > Package Manager, is Cinemachine shown as being installed? If not you should have a "Install" button that will re-add the package to your project and re-enable the usage of Cinemachine.


    Hi mronursari,

    It seems like in your Audio Settings you had "Loop" disabled. This means that the ghosts far away from the Player Character will only play their sound bite once, so by the time John Lemon has reached them the audio won't repeat and the ghosts will be silent instead. If you re-enable the "Loop" setting on your prefab, everything should be a-ok!


    Thanks everyone else for your comments and feedback! We're keeping an eye on the forums and updating/improving the tutorial based on your responses.
     
    EastanITF and tannerralph_unity like this.
  31. tannerralph_unity

    tannerralph_unity

    Joined:
    Jun 4, 2019
    Posts:
    6
     
  32. EastanITF

    EastanITF

    Joined:
    Jun 14, 2016
    Posts:
    2

    Thank-you, Cinemachine is now installed. :) I never removed it or anything else (I'm using a fresh install of Unity 2018.3.14f1 and I understand after doing some rather quick research that cinemachine was supposed to be bundled with Unity since then) but at least this is resolved. Thanks again, from a unity newbie.
     
    Last edited: Jun 6, 2019
    JacekMackiewicz likes this.
  33. willypep

    willypep

    Joined:
    Jun 6, 2019
    Posts:
    1
    Can I do this tutorial with an older version? 5.6.2f1?
     
  34. tannerralph_unity

    tannerralph_unity

    Joined:
    Jun 4, 2019
    Posts:
    6
    OK, now I'm up to step 7. I have put a capsule collider on the gargoyle, and I've double checked that the script is correct. But when I walk John Lemon into the flashlight, nothing happens. I tried changing the script from other.transform to other.gameObject. That didn't work either. Here is my Update() function:
    upload_2019-6-11_23-6-56.png
     
  35. Alu017

    Alu017

    Joined:
    Jun 10, 2019
    Posts:
    2
    Still on Section 3: Player character part 2. I finished all the code for this part and am pretty sure it's right, but when running the game, I get this error message:

    "MissingComponentException: There is no 'Animator' attached to the "JohnLemon" game object, but a script is trying to access it.
    You probably need to add a Animator to the game object "JohnLemon". Or your script needs to check if the component is attached before using it."

    Although I can see that I've added the animator component to the object. I also just copied their code into the script and it still wasn't working, so it's not a problem with the code. Any help would be really appreciated, thanks in advance.

    UPDATE: solved, solution in comments above.
     
    Last edited: Jun 13, 2019
  36. Alu017

    Alu017

    Joined:
    Jun 10, 2019
    Posts:
    2
    Thank you so much! Was having so much trouble figuring this out :)
     
  37. Nick1981

    Nick1981

    Joined:
    Jun 13, 2019
    Posts:
    2
    Hi All, I'm currently on the below part and when i bake the navmesh i don't see the light blue mesh. even when I'm in the navigation menu. I can't tick the show hightmesh in the bottom right of the below picture. any ideas why ?

    4. Select the Bake button at the bottom of the window. The bake process will take from a second to a few minutes, depending on the power of your computer. When it finishes, the environment in the Scene window will be covered in a light blue mesh. This is the area of the environment that the ghosts will be able to move around.






    The NavMesh will only be visible when the Navigation window is open and active (if you switch to the Inspector tab, the mesh will disappear from the Scene view). Don’t worry — even when you can’t see the NavMesh, it’s still there!


    5. Remember to save your Scene to avoid losing any changes.
     
  38. freeman40

    freeman40

    Joined:
    Aug 5, 2018
    Posts:
    1
    Great tutorial, really well written and achieves a good balance of explaining why things have to be done without getting too complicated or bogged down in details (i.e. you've hit the "beginner" level just right). I particularly liked that this *wasn't* a video tutorial - text and screenshots is so much easier to go back and forth if you want to refer back to something.
     
  39. phober

    phober

    Joined:
    Jun 16, 2019
    Posts:
    1
    Make sure that the Alpha parameter of the Canvas Group is set to 0
     

    Attached Files:

  40. Uhfgood

    Uhfgood

    Joined:
    Feb 22, 2013
    Posts:
    2
    TL;DR - If you put an animation controller on the rigid body on the John Lemon prefab, he simply falls off the screen. If you add the control to the rigid body of the actual game object in the scene that's not the prefab then he falls a short ways then stops.

    So I'm still on the Player character Part 1 tutorial and I've run into a little issue. I'm at section 11: Make your character react to physics. So I'm supposedly making changes to the JohnLemmon prefab. Okay so when I add a rigid body and play the scene, what happens is it falls off screen. This is what I would expect to happen given there's no floor. However, the tutorial says there's something not right, it falls a little way and stops. Now, if I instead apply the animation controller to the John Lemon game object in the scene INSTEAD OF the prefab, the character falls a short distance then stops, like the tutorial. Could anyone tell me what's going on here?

    Now it's acting even stranger. I deleted the prefab and game object I created and then recreated everything via the tutorial and now when I hit play instead of falling, the idle animation plays. I didn't set up anything for animation, but somehow it retained something from before.
     
    Last edited: Jun 18, 2019
  41. Gravener2591

    Gravener2591

    Joined:
    Jun 20, 2019
    Posts:
    1
    I’m having trouble with the gargoyle detecting John lemon I have rechecked the code this morning before I went to work and everything matches to the source code, I’m not sure why it’s not detecting.
     
  42. pedro_b

    pedro_b

    Joined:
    Jun 19, 2019
    Posts:
    1
    Hey all! First of all I'd like to say it's really great that you offer great tutorials like these for free for everybody to learn some basics of game developing. For that, I tip my hat to you, well if I had a hat I would.

    Alas, I'm here to talk about a potential bug, not exactly game impacting bug, but just a bit weird.
    Some more information below.

    Unity Version: 2019.1.7f
    Project: 3D Begginer (John Lemon’s Haunted Jaunt)
    Bug summary: So basically the character when bumping into certain objects (mainly the dining chairs), starts moving in idle position, even without the user pressing any of the arrow or WASD keys. First I thought it was a problem on my part, not following the tutorial's instructions, but then I downloaded the completed project and saw it also happened there.
    Attachment: Video examplifying the bug. https://we.tl/t-u0PYz4iKCu (size was too big to upload here; link will stay alive for 7 days).

    I know this isn't a very good way of reporting a potential bug, but I didn't really find a proper place to send it to. Anyway, I'll go tinker a bit on the project and see if I can find a solution. Reducing the collider's size for both the chair and John Lemmon seemed to help a bit, but I'm not sure if that's the right way to go.

    EDIT: I've solved the problem by making John Lemon's drag and angular drag quite high in the rigidbody component (in my case I changed it to infinity), which makes sense, since the problem wasn't in the motion itself, cause he was in idle position, but in some forces that acted upon John when he bumped into the dining chairs, and some other objects. This doesn't impact the rest of the game, because we're not using other forces that say knock John back or stuff like that. But if there were, then we needed to eliminate the forces that the chair exerts on John, I'm a begginer so not sure on how to do that, perhaps with a script?
    Image showing where to change the rigidbody drag and angular drag: https://prnt.sc/o57cy9

     
    Last edited: Jun 22, 2019
  43. KokonutKrab

    KokonutKrab

    Joined:
    Oct 12, 2018
    Posts:
    3
    Hi, new to Unity however very happy with your tutorial. I have reached a glitch in my efforts and I did go back and revisit the steps but could not find where I may have swayed off the path.

    I've reached
    Enemies, Part 2: Dynamic Observers >
    11. Assign the Nav Mesh Agent Reference to the Ghost Prefab

    4. Let’s check that your Ghost’s Observer script has the references it needs. In the Hierarchy, expand the Ghost GameObject and select the PointOfView child GameObject.

    5. Drag the JohnLemon GameObject from the Hierarchy window onto the Player field of the Observer script to assign its Transform.

    6. Next, click the circle select button and assign the GameEnding field. Since there is only one GameEnding Component in the Scene, there will only be one option for you to select.

    Is there a reason to for Step 4, because when I select PointOfView (in the Ghost GameObject), it only has the Transform component.
    Regarding Step 5., I can drag the JohnLemon GameObject over to the Observer script (Player field), but it won't allow me to drop it. I get a circle back-slash symbol.
    For Step 6, the circle select button opens a new screen, but there is nothing in the Assets list.

    Really appreciate the help, thank you.


    Here is my Observer Script, in case you need to check that:
     

    Attached Files:

    Last edited: Jun 22, 2019
  44. TimGuthoff

    TimGuthoff

    Joined:
    Jun 21, 2019
    Posts:
    1
    [QUOTE = "impaladesign, post: 4491610, member: 2852437"] Ich bin neu bei Unity und arbeite an John Lemons Haunted Jaunt. Ich erhalte den folgenden Fehler:

    MissingComponentException: Dem Spielobjekt "JohnLemon" ist kein "Animator" zugeordnet, aber ein Skript versucht, darauf zuzugreifen.

    Ich habe das Skript mehrere Male durchgesehen und im Inspector Animator Controller kann ich JohnLemon sehen. Ich habe das gegoogelt und kann keine Lösung finden. Kannst du sehen, wo ich falsch liege?

    Vielen Dank,

    Dan

    Hallo
    Ich habe die lösung
    Sie haben wahrscheinlich alle Komponenten, die Sie während des Lernprogramms hinzugefügt und im obersten Objekt namens JohnLemon bearbeitet haben.
    Sie müssen jedoch alle Komponenten im unteren Objekt JohnLemon hinzufügen.
    Dann klappt es.
    ich hoffe ich konnte helfen
     
    Last edited: Jun 24, 2019
  45. Tigger0606

    Tigger0606

    Joined:
    Jun 23, 2019
    Posts:
    4
    I get this error, infact have done so from the beginning.
    I am almost finished the tutorial and it hasnt been an issue so far, but I am concerned about what will happen when i try to build.
    I have tried to re-import several times.

    An error occurred while resolving packages:
    Project has invalid dependencies:
    com.unity.package-manager-ui: Package [com.unity.package-manager-ui@2.1.2] cannot be found

    A re-import of the project may be required to fix the issue or a manual modification of C:/Users/Bernard/Unity/3D Beginner/Packages/manifest.json file.
     
  46. Tigger0606

    Tigger0606

    Joined:
    Jun 23, 2019
    Posts:
    4

    4. Let’s check that your Ghost’s Observer script has the references it needs. In the Hierarchy, expand the Ghost GameObject and select the PointOfView child GameObject.

    5. Drag the JohnLemon GameObject from the Hierarchy window onto the Player field of the Observer script to assign its Transform.

    6. Next, click the circle select button and assign the GameEnding field. Since there is only one GameEnding Component in the Scene, there will only be one option for you to select.

    Did you expand the Ghost GameObject or open it in prefab?
    Expand is the triangular arrow on the left, prefab is the "greater then" symbol on the right
     
  47. mgrekt

    mgrekt

    Joined:
    Jun 22, 2019
    Posts:
    92
    Having trouble with movement... -> To be specific Lemon's rotation is fine, however when trying to move coordinates left-right-etc. stay the same. (Running with latest updates) Anything wrong with my code?
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class PlayerMovement : MonoBehaviour
    {
    public float turnspeed = 20f;
    Vector3 m_Movement;
    Quaternion m_Rotation = Quaternion.identity;
    Animator m_Animator;
    Rigidbody m_Rigidbody;


    // Start is called before the first frame update
    void Start()
    {
    m_Animator = GetComponent<Animator> ();
    m_Rigidbody = GetComponent<Rigidbody> ();
    }
    // Update is called once per frame
    void FixedUpdate()
    {
    float horizontal = Input.GetAxis ("Horizontal");
    float vertical = Input.GetAxis ("Vertical");
    m_Movement.Set(horizontal, 0f, vertical);
    m_Movement.Normalize ();
    bool hasHorizontalInput = !Mathf.Approximately (horizontal, 0f);
    bool hasVerticalInput = !Mathf.Approximately (vertical, 0f);
    bool isWalking = hasHorizontalInput || hasVerticalInput;
    m_Animator.SetBool ("IsWalking", isWalking);
    Vector3 desiredForward = Vector3.RotateTowards (transform.forward, m_Movement,
    turnspeed * Time.deltaTime, 0f);
    m_Rotation = Quaternion.LookRotation (desiredForward);

    }
    private void OnAnimatorMove()
    {
    m_Rigidbody.MovePosition (m_Rigidbody.position + m_Movement *
    m_Animator.deltaPosition.magnitude);
    m_Rigidbody.MoveRotation (m_Rotation);
    }
    }

    Edit: I Figured out my problem it wasn't the code, but my mistake of freezing the x and y.
     
    Last edited: Jun 27, 2019
  48. rmhoman

    rmhoman

    Joined:
    Feb 21, 2018
    Posts:
    1
    upon import of the package I get the following error, only on step 1 of part 2 can not proceed further Library\PackageCache\com.unity.cinemachine@2.3.3\Runtime\Behaviours\CinemachineStoryboard.cs(68,32): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?) using 2019.3.0a5
     
    bsmith3_unity796 likes this.
  49. LozzaL

    LozzaL

    Joined:
    Jun 14, 2019
    Posts:
    2
    Hi community,

    I'm having minor issue with Step 2. Everything is mostly working, however the walking animation is not smooth. I.e. after the walking animation, John Lemon warps back to a small fraction of the expected walk distance. This is my first project in Unity so would like some advice on how to get this animation to be smooth. I've followed the code exactly so I'm guessing it is some other root motion setting.

    EDIT:
    If anyone else has this issue, I was able to fix it by enabling the "Loop Pose" on the Walk Animation. I'm not sure if this is correct, but it makes the animation much more fluid.
     
    Last edited: Jun 26, 2019
  50. that-steve-guy

    that-steve-guy

    Joined:
    Apr 21, 2013
    Posts:
    15
    PKgamedesign and JakobeSVT like this.