I bought the C# master class on Udemy and I love it, thanks for all this great content. If you ever decided to make a tutorial on a rigidbody character controller, that would be awesome!
It can be everything. Maybe you typed in something wrong, or there is a conflict with the scripts name. describe the issue in your code and i will try to help you :)
Here I was struggling to make the character move not on the axis’s but by what way it’s facing (for months) and here you are who taught me how to do it in seconds
@@tutorialsEU I was thinking more about this: ua-cam.com/video/4HpC--2iowE/v-deo.html but with extra option to slide - wich I have controll how far my hovercraft is sliding
Good tutorial. But I did'nt notice any differnce implementing the LookAt feature. The Camera behaved exactly the same with or without implementing LookAt.
bruh i literally copied everything you did and my capsule is moving randomly i cant even control it Edit: i changed the capsule to a cube and disabled gravity option and it worked
How to make camera controls like if the player isn't happy with the camera i made but another player is can i make like a zoom in and out or let the player rotate the camera?
If your camera is not following the curve road/ direction wise=>using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraFollow : MonoBehaviour { public Transform target; public Vector3 cameraOffset; public float smoothF = 0.5f; public bool lookAtTarget = false; void Start() { cameraOffset = transform.position - target.transform.position; } void LateUpdate() { // Get the road's right direction Vector3 roadRight = GetRoadRightDirection(); // Calculate the desired position based on the road's curve Vector3 newPos = target.transform.position + roadRight * cameraOffset.x + cameraOffset.y * Vector3.up + cameraOffset.z * Vector3.forward; // Smoothly interpolate to the new position transform.position = Vector3.Slerp(transform.position, newPos, smoothF); // Optionally, make the camera look at the target if (lookAtTarget) { transform.LookAt(target.position); } } Vector3 GetRoadRightDirection() { // Find the road by tag or assign it directly in the Inspector GameObject road = GameObject.FindWithTag("Road"); if (road != null) { return road.transform.right; } else { Debug.LogError("Road not found. Make sure the road has the correct tag."); return Vector3.right; // Default to global right direction } } }
In the video, there is a variable named "smoothFactor" and its set to a value of 0.5f. Simply give smoothFactor a higher value, try something like 3f or 5f. This should remove the vibration / stutter / jitter. Hope that helps :)
Hi Mumin. This sounds like an interesting idea. I will run a survey to find out what app the students in my course are most interested in and I will add a shopping app to the options.
Hey, I'm trying to get the camera to follow my player in just a simple rolling ball game, but when I enter the code, it says "Assets\CameraMove.cs(8,12): error CS0246: The type or namespace name 'transform' could not be found (are you missing a using directive or an assembly reference?)" do you know how to fix this? awesome tutorial by the way
I know it has been a while but if you still need help, here is my answer to this ^^ Unity works with C#, and C# is Case sensitive, wich means, you have to type in the words correctly. As i see in the error message, youre trying to create a Transform variable. But instead of "Transform" you say "transform". Simply replace "transform" with "Transform" :)
I couldn't get this script to work.... I have a scene and character already made. adding the script to the camera and the target to follow does nothing at all. I tried both before and after adding the smoothing. It is as if the script doesn't exist at all..... Can someone help?
bUT PLEASE SOMEONE on this stupid you tube to explain how to folow prefab object ? i heve player selection on one scene and when i go to other scene my camera folowing characters spawing object but my player is moving and camera staying to folow targeting game object-do you understand me what i ask? please i cant find help enyware on whole stupid you tube!
🎮 Unity Masterclass - Master game development by building enjoyable games from scratch: bit.ly/3YJWe0N
my camera offset keeps changing when i play. why does this happen
nvm moved the camera and its better
@@kabirthaddeus3688 sus
Broo you are literally my freaking messiah right now. You rule, Boss
I bought the C# master class on Udemy and I love it, thanks for all this great content. If you ever decided to make a tutorial on a rigidbody character controller, that would be awesome!
Thank you!! 🙏🙏 it finally worked, after all those youtube tutorials and google searches
Just put the camaera inside the player its so easy
@@nameios6895 Ooh yeah thank you!
5:20 I was watching with a smile waiting for you to exit play mode :D I was expecting how far you would go with that 😂 Yeah, that happens.
This helped me tremendously and I really appreciate the thoroughness and the explanations on what you were showing in C#.
Yeah but it doesn't stay behind player
Just tried it again, and it works; all good. Thanks 👍
I litreally copied and pasted his code and guess what it does not work nothing he wrote is valid in December 2020 is it the same with everyone?
It can be everything. Maybe you typed in something wrong, or there is a conflict with the scripts name. describe the issue in your code and i will try to help you :)
Here I was struggling to make the character move not on the axis’s but by what way it’s facing (for months) and here you are who taught me how to do it in seconds
Thanks a lot man 😘 I was like...
"What the hell he is explaining slowly"
But It's beginner friendly 🥰 It helped me sure will help more people.
That was so useful. Holy crap. Thank you very much. Happy that you even explained slerp and lookat. 10/10
best tutorials
YOU SAVED MY LIFE, THANK YOU
Great tutorial! btw. do you have in plans to make top down 3 person hovercraft controller tutorial?
We are planning on adding a click to move tutorials. Is this what you mean?
@@tutorialsEU I was thinking more about this: ua-cam.com/video/4HpC--2iowE/v-deo.html but with extra option to slide - wich I have controll how far my hovercraft is sliding
Thx Bro
Nice Video Sir
nice tutorial i learned a lot but the camera si a bit bad i expected it to follow the direction of the player
I love you bro! New sub :D
Good tutorial. But I did'nt notice any differnce implementing the LookAt feature. The Camera behaved exactly the same with or without implementing LookAt.
Thank you very much!!
Hallo, why is the camera shaking, what I am doing wrong ?
bruh i literally copied everything you did and my capsule is moving randomly i cant even control it
Edit: i changed the capsule to a cube and disabled gravity option and it worked
Great video , please let me know if yall know how to lock the camera behind the player
I liked the pictures behind
Finally someone noticed them :)
The link is not working for the blog post .. :(
Thank You!!!!
thank you so much
How to make camera controls like if the player isn't happy with the camera i made but another player is can i make like a zoom in and out or let the player rotate the camera?
im getting alot of errors but il find it out
For me Video started from 8:32
I want the camera to stay behind the player like a 3rd person game. This is just tracking the player, not following.
idk why but the script aint working for me
cant believe I watched 10 minutes of this video just to watch you copy paste the first result for "unity 3d camera follow player" line by line
Hello so if i press a or d i fly up and down with this script help.
If your camera is not following the curve road/ direction wise=>using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour
{
public Transform target;
public Vector3 cameraOffset;
public float smoothF = 0.5f;
public bool lookAtTarget = false;
void Start()
{
cameraOffset = transform.position - target.transform.position;
}
void LateUpdate()
{
// Get the road's right direction
Vector3 roadRight = GetRoadRightDirection();
// Calculate the desired position based on the road's curve
Vector3 newPos = target.transform.position + roadRight * cameraOffset.x + cameraOffset.y * Vector3.up + cameraOffset.z * Vector3.forward;
// Smoothly interpolate to the new position
transform.position = Vector3.Slerp(transform.position, newPos, smoothF);
// Optionally, make the camera look at the target
if (lookAtTarget)
{
transform.LookAt(target.position);
}
}
Vector3 GetRoadRightDirection()
{
// Find the road by tag or assign it directly in the Inspector
GameObject road = GameObject.FindWithTag("Road");
if (road != null)
{
return road.transform.right;
}
else
{
Debug.LogError("Road not found. Make sure the road has the correct tag.");
return Vector3.right; // Default to global right direction
}
}
}
thank youu
how do you set the camera offset to 0? i want a first person game
Transform and vector could not found error cs0246 what to do
do you still have the problem? then send the errormessage in here.
Camera still vibrates a lot. How to fix?
Remove slerp maybe? xD
In the video, there is a variable named "smoothFactor" and its set to a value of 0.5f. Simply give smoothFactor a higher value, try something like 3f or 5f.
This should remove the vibration / stutter / jitter. Hope that helps :)
Tutorial about camera starts at 5:26
Can you copy the code ?
Please I really need help on my programming instructions on building a shopping app
Hi Mumin. This sounds like an interesting idea. I will run a survey to find out what app the students in my course are most interested in and I will add a shopping app to the options.
@@tutorialsEU how can I be a student please
@@muminoloruntola2146 by joining my Android Masterclass. www.udemy.com/course/android-kotlin-developer/?couponCode=YTANDROID0820
@@tutorialsEU Ok thank you
@@tutorialsEU I hope we also have your contact for personal help after the masterclass
none of the code that you send worked for me ;-; please help😐
😭😭😭please say for me i got much erorrs say for me how i make this erorrs out
By debugging!
Hey, I'm trying to get the camera to follow my player in just a simple rolling ball game, but when I enter the code, it says "Assets\CameraMove.cs(8,12): error CS0246: The type or namespace name 'transform' could not be found (are you missing a using directive or an assembly reference?)" do you know how to fix this? awesome tutorial by the way
The same comes up on mine
I know it has been a while but if you still need help, here is my answer to this ^^
Unity works with C#, and C# is Case sensitive, wich means, you have to type in the words correctly.
As i see in the error message, youre trying to create a Transform variable.
But instead of "Transform" you say "transform".
Simply replace "transform" with "Transform" :)
I couldn't get this script to work.... I have a scene and character already made. adding the script to the camera and the target to follow does nothing at all. I tried both before and after adding the smoothing. It is as if the script doesn't exist at all.....
Can someone help?
same problem here
@@foreignwarren7361 Just drag the camera into the player
@@nameios6895 I know this is an older comment but maybe their game isnt first person
Or just drag your Camera inside of your Player (Cube for instance)
Wow thanks it worked😁
Omg this so much better
how do i get to that code screen?
Hey I'm really late, but if you still want to know you need to install visual studio. It's free and you can link it to Unity or something.
@@greasychickenugget4410 thx 😍🥰😘
bUT PLEASE SOMEONE on this stupid you tube to explain how to folow prefab object ? i heve player selection on one scene and when i go to other scene my camera folowing characters spawing object but my player is moving and camera staying to folow targeting game object-do you understand me what i ask? please i cant find help enyware on whole stupid you tube!
my character can go through the walls
Naruto Uzumaki 🔥
Joe you say...
hay qua
Me after seeing yandere dev's code
14:16
*If statements, we meet again*
Mouse X
Add you kidding?
Llu