FIRST PERSON MOVEMENT in 10 MINUTES - Unity Tutorial

preview_player
Показать описание
FIRST PERSON MOVEMENT in 10 MINUTES - Unity Tutorial

In this video I'm going to show you how to code full first person rigidbody movement. You can use this character controller as final movement for your game or build things like dashing, wallrunning or sliding on top of it.

If this tutorial has helped you in any way, I would really appreciate it if you leave a like in return. And you can also subscribe to this channel if you want to see more tutorials like this one.

Links:

➡️ Get Access to my full MOVEMENT LAB!➡️

🏹 Get Access to my RANGED COMBAT LAB!🏹

Other interesting videos :D

Support me on Patreon:

#UnityMovement #FirstPersonMovement #UnityTutorial
Рекомендации по теме
Комментарии
Автор

This tutorial was great but one small problem. I couldn't get the capsule to jump until I compared my script side by side with your script and noticed that in the video you do not say to add the following line to Start()

readyToJump = true;

You might consider updating your description so people know. I spent awhile trying to figure it out comparing everything I did from the video before I gave up and looked at your script.

edit: this was a year ago, still getting thanks to this day. never expected to get this much support, thank you all for the 1k likes. means alot. good luck on your movement systems everyone!

pikapikalis
Автор

for anyone struggling with the player sticking to walls; Make a Physic Material with little to no dynamic friction (I used a value of 0.1 with Friction Combine at Minimum) and assign it to the player's Collider. You can experiment with different friction values to find what works best for your game

Hietakissa
Автор

Thanks a bunch! For someone like me who's absolutely new to programming in unity I'm appreciative that this is low-level enough for me to able to understand why each piece of code is being inputted.

jehriko
Автор

I was doing my own FPS controller without any guidance and everything was alright but some weird camera jitter so I decided to check how everyone was tackling the camera. I never thought of having it outside the hierarchy of the player. Now I have 0 problems amazing idea!

Alejandro_Berra
Автор

if you have a problem with the ground check then just add an empty game object at the bottom of the player then write this:
grounded = Physics.CheckSphere(groundCheck.position, groundDistance, whatIsGround);

with these as variables:
public Transform groundCheck;
public float groundDistance = 0.4f;
public LayerMask whatIsGround;
bool grounded;

i got this from brackey's fps tutorial btw and it seems to work nicely with this script.

thxr
Автор

Just found your channel. Thanks for all the tutorials you're doing and keep it up!

Seestral
Автор

Your methods are so simple! I've ran into multiple problems with syncing the camera with an object that has a character controller before. Similarly, I had to do mental gymnastics just to figure out how to move the player based on the camera's perspective. Having an object whose only function is to keep track of orientation saves a lot of mental work and is definitely a game changer. I need to think like that more! Glad to have found this tutorial. Great stuff man!

Inferim
Автор

Thanks a lot Dave, appreciate the fact you're providing this content, and consolidating it to only 10 minutes so we can crunch through it. Its a good way to work.

All the best!

jacksmith
Автор

This was an Amazing guide, and it helped a lot with my first game!

liamwhillier
Автор

For anyone having trouble with the Jump function : we just have to set readyToJump to true when we begin (its not shown in the video)

christophermohite
Автор

I followed this to the letter, and I had jumping like I was on the moon. I did solve it myself by downloading the original source files and I found that the global value for the Gravity's Y value is set to -30. For a default project it set to -9, so this is an omission in the video. You can find this setting under Edit -> Project Settings and just make sure its set to -30 and you'll be back on earth lol.

ExamProChannel
Автор

For anyone that has stuttering / jittering issues with their camera: There are 2 options how you can fix it
• Remove the "* Time.deltaTime" from the PlayerCam Class where getting the input
• Replace the "* Time.deltaTime" in the PlayerCam class with "* Time.fixedDeltaTime"

_ace
Автор

If you are still having trouble with "penguin sliding" after adding drag double check the position of your capsule in your player holder, if like me you moved the capsule at some point to align things it moves the starting point of the raycast with it, so make sure your capsule has 0, 0, 0 for position.

For me my capsule was 0, 2, 0 and as such my raycast was starting lower then my player. I found this out by starting the game, then hitting esc to free my mouse then change to scene view, I then selected my player holder and unchecked "use gravity" to allow me to drag my player holder up while looking at 'Drag' in the Rigidbody and after my player was hovering ~1 unit in the air my Drag jumped from 0 to 5 which is what my GroundDrag was set to at the time

razamondo
Автор

I looked at over 10 videos, but this... this is just the best. Keep up the great work!

Tye_gameDev
Автор

this is the best movement tutorial ive been able to find since Brackeys, thank you :)

Sputterbugz
Автор

this is the first time i've ever finished a unity tutorial lol hell yeah motivated af now

cboyslim
Автор

I played dying Light 2. I don't like how the controller feels. So now I'm trying to understand how movement, vaulting, etc. works. Then make an obstacle course, code in the movement and tune it until it feels fun.

thefunnybuddy
Автор

thanks for the tutorial!!
if yall can't jump you can put "readyToJump = true;" in Start() or just when you create the variable initialise it to true ("bool readyToJump = true;").
if ur jumps are huge and fall slowly, i found that increasing the rigidbody's mass in Unity helped, I liked 1.6 but tweak it for yourself. also tweak the jumpForce, i'm at 10.

libbycb
Автор

This is very good I just started coding in unity and I understand the code very well with this!

Yukiikakkoi
Автор

great videos, I'm using this tutorial to check I didn't create my player controller in an unscalable way and its helped a lot. Thanks for the video chief.

noodletree