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

Thank you!

1 Like

I’m struggling with the chapter “The Environment”. I cannot find the “MainScene” you’re referring to. I’m using the “3D Beginner Tutorial Resources” package and there’re no scenes inside of the project resources (as far as I can see). When I take a look into the “3D Beginner Complete Project” resource packages, I can find the MainScene of cause, but were I really wrong, using the Tutorial resource package instead of the “Complete Project” package?? Thanks Mario

On this page: Write a script for character movement - Unity Learn the code blocks use “fancy quotes”, for instance around Horizontal in the Input.GetAxis call. If a C# beginner were to copy-paste this into VS it would not compile.

Ok, found my fault, I didn’t saved sample scene in chapter 2 as main scene, therefore I was confused, because I thought there must be a preconfigured mainScene, instead it starts with the empty scene and dragging the level prefab into the scene is doing the trick.

1 Like

I started the tutorial quite exited and I got frustrated as soon as the code was introduced and ended up skiping and just pasting the code without reading most of the explanations. I just couldn´t follow.
I think the coding part is way out of the scope of an actual beginner.I get it has to be takled but… maybe in a easier way.

I am also having the same problem; my Visual Studio is also telling my there are no problems with my code but when i go into unity it gives me “Assets\Scripts\PlayerMovement.cs(17,35): error CS0246: The type or namespace name ‘m_Animator’ could not be found (are you missing a using directive or an assembly reference?)” and “Assets\Scripts\PlayerMovement.cs(18,36): error CS0246: The type or namespace name ‘m_Rigidbody’ could not be found (are you missing a using directive or an assembly reference?)”

Hi, I’m having trouble on Player Character Part 2 - Step 17. When I hit Play, the character doesn’t respond to input on other the directional arrows or w, a, s, d. Upon checking the “Animator” tab, I noticed that a light blue progress bar fills from left-to-right repeatedly while the scene is playing. Please see my movement script here to check for errors as well.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
public float turnSpeed = 20f;

Animator m_Animator;
Rigidbody m_Rigidbody;
Vector3 m_Movement;
Quaternion m_Rotation = Quaternion.identity;

// Start is called before the first frame update
void Start()
{
m_Animator = GetComponent();
m_Rigidbody = GetComponent();

}

// 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);
}

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

Any other suggestions for where I should check things are going wrong?

I’ve finished the tutorial, and the game runs well in every way except for one: the long hallway with the two rooms and the ghost. I cant get Mr. Lemon to enter these rooms. For gameplay, entering these rooms is pretty vital, otherwise you die by ghost. How do I fix this?

Sounds like you didn’t name the Boolean variable IsWalking correctly during the Animator setup. Ensure it has a capital I and isn’t spelled incorrectly as ‘isWalking’

Hi! I’m new to unity and have now almost completed the whole tutorial but I have a problem with my ghosts. I have entered the same position values as the tutorial show, however all ghosts (except the ghost in the first room, who is floating above the walls) go through the floor (see picture).

I’m not sure what the problem is and what I need to change in order to make them walk on the floor. Is it something I have missed or something in the script?

I encountered an issue when copying the PointOfView object into the Ghost (and making duplicates). Although the PointOfView object had the observer script and showed the Player and Game Ending as the expected objects, the collision did not happen. I had to reassign the same objects to the Player and Game Ending variables (even though they appeared to already be assigned). Is there some reference that may have been incorrectly copied? I believe I followed Dynamic Observers section 5 precisely.

I couldn’t get the ghosts to move along the nav mesh. Did anyone else have this problem by the time they reached the audio portion of the tutorial?

2 Likes

have you checked to see if the y position value of your floor is beneath the y value for the ghost?

Hi,
I’m nearly at the end of “Player Character: Part 2” and I have to admit that there is not much that I can understand about the code that is being used so far.
I’m not sure if it is presented just as an introduction of “how, where or when” to put code. Or, in order to continue further in the course, I am supposed to pecisely understand what Im doing… The thing is that I don’t get it.
Is this expected? Can I go on or should I leave it here?
Thanks

You are supposed to write the code yourself. And not rushing it, trying to understand each step then you wont run into these kind of bugs or you notice. What i am doing is i am trying to do the part by myself before reading. Then read it bt no look at code after i managed to do something working as intended i check the code to see how could it be writtten more effectively. Almost all the time i see i could write the code better yet almost every time i could do what i wanted to do somehow even if its not the best way.

Actual beginner in this context is new to unity and game development. It doesnt have to mean no programming experience at all. Any source on anywhere will actually advice you learn some kind of programming before going through game development. As a beginner to unity and and game development,but having C programming background i found courses at exact level i suppose them to be. Unity learn isnt supposed to go through 30 hours of variables, loops course when there is hundreds of them can be found online for free.

Pick a main stream programming language like python/c++ even javascript does the job. Find an online course. Go through it. Return when you finish, start over, try to understand each thing you do. It will keep you busy for 2 weeks 2 hours a day now. But it will save hundreds of hours later.

I can’t get past the second lesson because apparently, the asset does not import fully. As soon as it asks me to look at “root” I can only see legs but no arms, as the tutorial asks.

I didntdo 3d one i am doing 2d one but did you try cleaning the project and downloading fresh ?
Edit : Also double check constraints, rigid body and colliders. İts possible that you made a mistake and upperbody goes through floor due to gravity.

Hi everyone. First let me start with a praise, great job with this tutorial, from the detailed (and encouraging :)) description, pace at which new concepts are introduced, script examples etc. This is how an introduction to a new framework / language should be done in general (and it rarely is).

I would like to report a small issue I had with the WaypointPatrol script from the tutorial; all my ghosts stopped a bit before the first waypoint as the remaining distance was never smaller than the stopping distance. I don’t know if I missed some configuration and the problem is on my side but such behavior kinda makes sense to me. With the expression changed to navMeshAgent.remainingDistance <= navMeshAgent.stoppingDistance the enemies behave as expected.

2 Likes