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

Alongside our brand new Learn platform, Unity’s Learn Content team have released a new beginner project. This project is a great way to introduce you to beginner code, physics, 3d environments, cameras and more, all wrapped up in a stealth game mechanic.

Step by step, create your own haunted hotel game using the beautiful 3D assets provided. The written lessons have editor screenshots and gifs to help you learn how the adorably creepy hotel was created and make your own version for John Lemon to tremble around.

For the first time we’ve released two versions of our project. You can find the tutorial project where you build the game from scratch, but also the completed project where you can see how we’ve made the demo level and play the game in the editor.

Find the tutorial on the Unity Learn site here

Download the Tutorial Project here

Download the Complete Project here

11 Likes

Thanks for providing this!

I found a small error in the tuitorial on this page:

Under
6. Layouts

It says:

4 Split
This layout is good for looking at 3D models from different angles, but not much use for our 2D Project.

This is a 3D project, so I found this bit confusing - but it’s obviously copy-paste error.

Not an error at all. If you read correctly, this part is just a description of all the available layouts in the editor whatever the project or tutorial you are working on.

What’s the usage license for the tutorial assets? I can’t find it anywhere. Thanks!

The licence details are probably inside the project resources you downloaded; generally a text file that displays in the Inspector view on launching the project.

Thanks for answering, but I already looked there. :frowning:
There’s no information about the license in the Asset Store project description either.
I’ll suppose they’re free to use in any non-comercial project.

For anyone interested this code snippet draws the pathing of the enemies (the waypoints) so that you can see what their patrol path looks like

private void OnDrawGizmos()
    {
        Gizmos.color = Color.green;
        for (int i = 0; i < waypoints.Length; i++)
        {
            Gizmos.DrawWireSphere(waypoints[i].position, .5f);

            if (i + 1 < waypoints.Length)
            {
                Gizmos.DrawLine(waypoints[i].position, waypoints[i + 1].position);
            }
            else
            {
                Gizmos.DrawLine(waypoints[i].position, waypoints[0].position);
            }
        }
    }
4 Likes

Just ran through this tutorial, all great stuff and a LOT of stuff for a beginner. Its a really well written tutorial, one bit of feedback I have is that it would be really helpful if you could include comments in your c# and shader code so that you don’t have to always refer back to the tutorial pages to know what everything is there for (especially helpful in those shaders). Thanks for the great work!

3 Likes

I’m new to Unity and am working on John Lemons Haunted Jaunt. I am getting the following error:

MissingComponentException: There is no ‘Animator’ attached to the “JohnLemon” game object, but a script is trying to access it.

I have gone through the script several times and in the Inspector Animator Controller I can see JohnLemon. I have googled this and cannot find a solution. Can you see where I am going wrong?

Thanks,

Dan

10 Likes

Hello, I am currently in the Part 2 of the tutorial and I have followed the steps in order to make JohnLemon able to walk and turn, but in the end when i am playing the game the character only turns but he is unable to walk. I went back to my code to check for error but couldnt find any. I also copied pasted the code from the end of the tutorial, just in case i miss something but still no walking for the character. Any help would be welcome.

3 Likes

Iv been doing this tut as well it’s good I did run into some of the same problems
Their is no reference and m_Animation
I had 4 errors I did not give up I finished the script without errors just read what c# is telling you because I found auto type sometime gives u a way to do it different or correct it I was kinda excited to try it and I did JL falls through my code is correct ridge body physics?

The thing is I get no errors - no warnings on Visual Studio.

Also I see that
using System.Collections;
using System.Collections.Generic;

are not getting used. Which is weird.

3 Likes

you don’t have to worry about it basically its saying that you’re not using those in the script and you can remove them if you want to(Don’t remove them until you have finished the tutorial)

I just downloaded the project and i can’t get it to run. It says there are issues with dependencies and things not existing .

3 Likes

I know, but still my code doesn’t work for walking and i have no errors - or warnings. Is it possible any of you that made it work, to post here the code for the PlayerMovement?

here is the code, you can move him using wasd or arrow keys

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);
    }
}
2 Likes

I had the same issue, this has something to do with version 2018.3 of unity, the fix is to delete the manifest.json in the Packages folder of your project.

https://discussions.unity.com/t/714635

2 Likes

I initially couldn’t get him to move as well, but once I checked the exact Case and Spelling in my script to the animator I created in Unity I could see my case was wrong.

1 Like

nah, still doesnt work!!!

I dont get what u did to fix it. can u elaborate?

I found out what was it. In the animator my bool var was isWalking while in the code was IsWalking. fml! I was so frustrated

3 Likes