FIRST PERSON MOVEMENT in Unity - FPS Controller

  Рет қаралды 3,213,154

Brackeys

Brackeys

4 жыл бұрын

Let's see how to get an FPS Character Controller up and running in no time!
REGISTER with APPTUTTI: www.apptutti.com/partners/reg...
LEARN MORE: www.apptutti.com/corporate/?u...
● Ultimate FPS asset: assetstore.unity.com/packages...
● New Input System: • NEW INPUT SYSTEM in Unity
● FPS Shooting: • Shooting with Raycasts...
····················································································
❤️ Donate: www.paypal.com/donate/?hosted...
► Join Discord: / discord
● Website: brackeys.com/
● Twitter: / brackeystweet
● Instagram: / brackeysteam
········································­­·······································­·­····
► All content by Brackeys is 100% free. We believe that education should be available for everyone.
❤️ Donate: www.paypal.com/donate/?hosted...
········································­­·······································­·­····
♪ "ES_Dress Code_Black - oomiee" by Epidemic Sound

Пікірлер: 14 000
@Danidev
@Danidev 4 жыл бұрын
Yeeey you're finally back! Been waiting for this one! :DDD
@pharmacist66
@pharmacist66 4 жыл бұрын
Dani Man you’re fast I just got the notification
@crowgaming7156
@crowgaming7156 4 жыл бұрын
hi
@Beengus
@Beengus 4 жыл бұрын
WHERES MY MOBILE PORTS NERD
@user-ob5hj5vn8c
@user-ob5hj5vn8c 4 жыл бұрын
Dani your the man, keep up your devlogs my dude.
@AB-hr4qg
@AB-hr4qg 4 жыл бұрын
I played karlson for 2 hours .... idk why
@None-nh3xb
@None-nh3xb 3 жыл бұрын
4:51 Mouse Controls 11:13 Key Controls 15:14 Gravity 21:21 Jumping
@ANZARIZ_43
@ANZARIZ_43 3 жыл бұрын
thanks
@kepleda
@kepleda 3 жыл бұрын
Let's Make This The Top Comment
@aprameyanaganur2934
@aprameyanaganur2934 3 жыл бұрын
Nice. Pin this comment Brackeys!
@thereaper5847
@thereaper5847 3 жыл бұрын
BRACKEY PIN THIS
@thereaper5847
@thereaper5847 3 жыл бұрын
Who just liked my comment
@zeroplayz5525
@zeroplayz5525 Жыл бұрын
Brackey is a legend. I followed 6 different tutorials in order to make a first person controller, I was starting to give up until I remembered your channel and I followed this video. You are the reason why I haven’t given up game development. Thank you.❤
@donalodomhnaill
@donalodomhnaill 9 ай бұрын
Exactly the same here!
@FYFTYNDIGITSLoF
@FYFTYNDIGITSLoF 2 ай бұрын
I have been searching for ages to find a good movement, I am acutaly saying this as unity is loading so I have faith but idk
@letthatbe
@letthatbe 23 күн бұрын
But you have given up right? :D
@FYFTYNDIGITSLoF
@FYFTYNDIGITSLoF 11 күн бұрын
@@letthatbe nope
@bonestudios7777
@bonestudios7777 5 ай бұрын
4 years in and this is one of the best movement tutorial that I found out there
@godot-boy7694
@godot-boy7694 3 жыл бұрын
Mr. Brackeys we noobs will always respect you as our teacher. You left KZfaq but you cannot leave our hearts, sir.
@BluePhantomGames
@BluePhantomGames 3 жыл бұрын
why is he not responding?
@zaimy5779
@zaimy5779 3 жыл бұрын
*salut*
@jacobbern9591
@jacobbern9591 3 жыл бұрын
may he teach us trough eventually out dated videos
@vozzy06
@vozzy06 3 жыл бұрын
Yash :The Gaming Boy i think he didnt look up his youtube page again
@sandroalderucci7949
@sandroalderucci7949 3 жыл бұрын
amen
@SrStakeholder
@SrStakeholder 4 жыл бұрын
I heard that Bethesda offices doesn’t have doors, the staff just clip trough the walls.
@mfatihbilhaq4977
@mfatihbilhaq4977 4 жыл бұрын
Yep that required 100$/year.
@SubjektDelta
@SubjektDelta 4 жыл бұрын
@ yes you are, not joking.
@skaruts
@skaruts 4 жыл бұрын
lol you made my day. :D
@rakodoza7601
@rakodoza7601 4 жыл бұрын
@@skaruts "People will buy everything" - Todd 2018
@Cxdyy
@Cxdyy 4 жыл бұрын
Lmaoooooooooooooooooooooooooooooooooooooooooooooooo
@stefaniebowles9401
@stefaniebowles9401 Жыл бұрын
For sure one of the best Unity how-to’s I’ve come across. You break it down so well and make it easy to follow and understand. Definitely subscribing - thanks!
@RiftCuber01
@RiftCuber01 Жыл бұрын
Really concise, this is the best fps programming tutorial I have seen so far!
@zacoriot
@zacoriot 3 жыл бұрын
Me: *Runs into an error* Me: *Stairs blankly at my code* Brain: "Just look up the error on google" Me: *continues to stair blankly at my code* Brain: "JUST LOOK IT UP" Me: "Yeah. your right... Time for a new project"
@user-hf6os1qb2w
@user-hf6os1qb2w 3 жыл бұрын
I dunno if you will find it helpfull but with F5 you can run the code and in bottom console it will show you errors
@bobdagamer640
@bobdagamer640 3 жыл бұрын
Alt + f4 I believe is good
@yeahnope2349
@yeahnope2349 3 жыл бұрын
@@bobdagamer640 For a split second, i went "Huh I didn't know they could do tha-- wait a second...
@bobdagamer640
@bobdagamer640 3 жыл бұрын
Lol
@kortenue
@kortenue 3 жыл бұрын
I forgot a comma when that almost happened
@herpderp246
@herpderp246 4 жыл бұрын
me: trying to slowly and methodically type out a script. brackeys: I AM SPEED.
@StarzzDrak
@StarzzDrak 4 жыл бұрын
bruh i have the same problem except i need to set video speed to 1.25 :D
@stupidrobot7386
@stupidrobot7386 4 жыл бұрын
StarzzDrak good for you but.... we didn’t need to know that
@StarzzDrak
@StarzzDrak 4 жыл бұрын
@@stupidrobot7386 yes but its life struggle for both of us.. that was the point
@SwedishVikingMC
@SwedishVikingMC 4 жыл бұрын
@@StarzzDrak Why are you watching a beginner tutorial if you're a more experienced programmer? lol
@StarzzDrak
@StarzzDrak 4 жыл бұрын
@@SwedishVikingMCbruh why not ? I haven't created a single 3d character controller in 3 years
@bernardmasika
@bernardmasika 11 ай бұрын
brackeys explains things with diagrams before starting to demonstrate, such a gem. this tutorial still make sense up to today, well apart the fact that you will have to consider using the new input system. Thanks a lot! i just hope you will be back one day, in publishing tutorials
@amanewithjesus5244
@amanewithjesus5244 11 ай бұрын
Jesus is lord follow him and you will be saved
@Yoctopory
@Yoctopory 11 ай бұрын
@@amanewithjesus5244 What's wrong with you?
@phillipdean9830
@phillipdean9830 Жыл бұрын
Worked perfectly after a few hiccups (probably on my end). So much better explained and implemented compared to this other tutorial I followed. Highly recommended!
@redliam5
@redliam5 4 жыл бұрын
I think Brackeys is psychic, EVERY SINGLE TIME I am going to start a project, he does a tutorial on the exact type of game it is.
@zerogaminghq5430
@zerogaminghq5430 4 жыл бұрын
Similar! I think huh what if bracket did first per- New video 🤔
@thellamawaffle6817
@thellamawaffle6817 4 жыл бұрын
yeah! what is up with that..?
@lurtztheorc
@lurtztheorc 4 жыл бұрын
TheLlamaWaffle He has secretly implanted mind reading devices in our brains through us watching his vids. He then uses unity to see what we want.
@Gamer-uf1kl
@Gamer-uf1kl 4 жыл бұрын
I am new here so the most types of game i make are here
@catacylist2933
@catacylist2933 4 жыл бұрын
What if brackets did a mech game tutorial
@Yoctopory
@Yoctopory 3 жыл бұрын
God creating the universe: "..and of course let's multiply with Time.deltaTime".
@marshgd
@marshgd 3 жыл бұрын
lol
@vaglo701
@vaglo701 3 жыл бұрын
underrated xd
@otsutsuki.7653
@otsutsuki.7653 3 жыл бұрын
HAHAHAHA
@Aries-tp8sk
@Aries-tp8sk 3 жыл бұрын
69th like
@Yoctopory
@Yoctopory 3 жыл бұрын
@@Aries-tp8sk nice ;)
@random_guy-rz8vz
@random_guy-rz8vz 3 ай бұрын
I'm making a third person controller with the new Input System and Cinemachine. I finally figured out basic movement but I had no clue how to add jump and gravity mechanics. Your method worked perfectly. Thanks mate!
@fluberdebluber7566
@fluberdebluber7566 12 күн бұрын
Im totally fresh to this, and when all the other tutorials buried me in errors this one was a saving grace! Thank you so much!
@casssaph2287
@casssaph2287 3 жыл бұрын
me: sees "quaternion" me: "ok so basically its black magic and i dont need to know how it works"
@youneskasdi
@youneskasdi 3 жыл бұрын
It is in fact one of the coplex parts of game dev you are better off not diging into it if you don't want your head to hurt
@dzvidea5065
@dzvidea5065 3 жыл бұрын
@@youneskasdi i did an oopsie... i dug into it you weren't wrong, my head hurts
@scorpoinlol97
@scorpoinlol97 3 жыл бұрын
@@dzvidea5065 same here
@eleazarpeniel1619
@eleazarpeniel1619 3 жыл бұрын
@@youneskasdi I read an article about it and understand absolutely nothing
@copperwires9663
@copperwires9663 3 жыл бұрын
I think it's a way of showing positioning on a 4 dimensional axis, which is why it can be used to shoe rotation and position in 3d games
@basilbravo6361
@basilbravo6361 3 жыл бұрын
me: types the code and follows each step carefully. unity: 249 errors take it or leave it.
@Mr-px4nz
@Mr-px4nz 3 жыл бұрын
I also have such a problem. Can anyone help with that? :(
@tverroryt
@tverroryt 3 жыл бұрын
@Liftnop i have so much erors
@sembos1151
@sembos1151 3 жыл бұрын
@@Mr-px4nz using System.Collections; using System.Collections.Generic; using UnityEngine; public class movement : MonoBehaviour { public float mouseSensitivity = 100f; public Transform playerbody; float xRotation = 0f; // Start is called before the first frame update void Start() { Cursor.lockState = CursorLockMode.Locked; } // Update is called once per frame void Update() { float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime; float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime; xRotation -= mouseY; xRotation = Mathf.Clamp(xRotation, -90f, 90f); transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f); playerbody.Rotate(Vector3.up * mouseX); } }
@youtubespyder4389
@youtubespyder4389 3 жыл бұрын
dude thats something thats weird
@arandomeditor972
@arandomeditor972 3 жыл бұрын
Pls help I followed all the steps but it says file missing when I try to add movement
@fearedwolf1731
@fearedwolf1731 Жыл бұрын
Brackeys I almost quit watching you becuase I thought unity cost money but now im back and realised your my best source of knowlage.
@hmmmmm8716
@hmmmmm8716 Жыл бұрын
My first in-game code ever written, I did complete an online course of C# so I get the basic stuff and some advanced stuff but application in the engine is beyond me. Super helpful tutorial, very happy I found this, Thank You!!!!
@SyncroxDeeznuts
@SyncroxDeeznuts Жыл бұрын
Make sure you add the camera as a child object to the player
@vasatruhl
@vasatruhl Жыл бұрын
Brackeys is a life saver :D
@thewatermelon_thing7083
@thewatermelon_thing7083 3 жыл бұрын
Unity: "No errors detected!" Me: Falling through the ground at 5000 miles per hour.
@p4tk47
@p4tk47 3 жыл бұрын
Unity: "No Errors detected" Me: Jump, no :(
@leonardpertsch8784
@leonardpertsch8784 3 жыл бұрын
@@p4tk47 same. did you fix it?
@hamoodibtw5550
@hamoodibtw5550 3 жыл бұрын
how to fix?
@skphotography6982
@skphotography6982 3 жыл бұрын
@@p4tk47 SAME
@francomarini6311
@francomarini6311 3 жыл бұрын
do you have a terrain or a plane with a collider on it?
@nietzsche14
@nietzsche14 3 жыл бұрын
Me acting like I understand and am not just copying everything he is doing. "mhmmmm"
@davez2796
@davez2796 2 жыл бұрын
hhahhahah same
@sillymortalz
@sillymortalz 2 жыл бұрын
It’s weird, because the third person video’s method or script was so confusing and unknown to me but this one all makes sense?
@cubecraftgaming9669
@cubecraftgaming9669 2 жыл бұрын
@@sillymortalz Same XD
@lakshyakumar4459
@lakshyakumar4459 2 жыл бұрын
please help my code isnt working
@lakshyakumar4459
@lakshyakumar4459 2 жыл бұрын
if once i added the ycode for it to move p and down only that worked it stopped looking aroud i reallycant explain
@aleksiszaps8423
@aleksiszaps8423 2 жыл бұрын
its realy nice that u explain everything unlike some other youtubers- i just hate it when they start typing with the speed of sound, say nothing abaut what they did and end the vid
@pugwilldestroygaming9769
@pugwilldestroygaming9769 Жыл бұрын
this tutorial is amazing. im making a game where you explore mars and find aliens and stuff but couldn't figure out how to jump, i ended up using the first part of the tutorial as a "jetpack" and calling it a day
@everydayisntnormal6945
@everydayisntnormal6945 Жыл бұрын
wow
@IamDrDapper
@IamDrDapper Жыл бұрын
Genius
@BreadAckerman
@BreadAckerman Жыл бұрын
God damn it he must not live he possesses the "i will improvise" strategy.
@fabioeditz8430
@fabioeditz8430 3 жыл бұрын
Me: Copies perfectly Unity: 964 ERRORS
@aravind.s1187
@aravind.s1187 3 жыл бұрын
LOL
@TKTC_The_Key
@TKTC_The_Key 3 жыл бұрын
Only?
@fabioeditz8430
@fabioeditz8430 3 жыл бұрын
@@TKTC_The_Key Yea!. Im just good like that.
@faynon8765
@faynon8765 3 жыл бұрын
you forget the dot '-'
@tfeak2101
@tfeak2101 3 жыл бұрын
don't just blandly copy from it try learn and understand what he is doing so you can apply it again next time, otherwise whats the point.
@maxdukhovskoy1406
@maxdukhovskoy1406 3 жыл бұрын
Me: "ok, I copied this perfectly, it should work..." Unity: nah, we don't do that here.
@kanesiajones4407
@kanesiajones4407 3 жыл бұрын
Use 2019.4 either that or your a lire
@azzy1220
@azzy1220 3 жыл бұрын
@@kanesiajones4407 r/woooosh
@mohamed-nx8ll
@mohamed-nx8ll 3 жыл бұрын
@@kanesiajones4407 r/woooosh
@jihannireshwalia7603
@jihannireshwalia7603 3 жыл бұрын
@@kanesiajones4407 r/woooosh
@whoisthisuserthough
@whoisthisuserthough 3 жыл бұрын
@@kanesiajones4407 r/woooosh
@Youngstupidkid
@Youngstupidkid Жыл бұрын
I love this tutorial!! I also love all the people who are helping in the comments, great video, great audience, thank you all!
@Phniblet
@Phniblet Жыл бұрын
The best general unity player movement tutorial on youtube!
@paynesmells
@paynesmells 3 жыл бұрын
Me: Movement doesn't work. Me: Looks for the error in the script. My Brain: Everything is correct! Me: Sees that the script isn't even enabled.
@frindjinny6
@frindjinny6 3 жыл бұрын
where do i pu tthe comma it wants me to put a comma WHERE IS IT AAAAAAAAAA
@snoutgames4940
@snoutgames4940 3 жыл бұрын
i've done that so much lol
@TinyDeskEngineer
@TinyDeskEngineer 3 жыл бұрын
Meanwhile I'm not even using a version of Unity which supports the input system used in the video. And the video on the new input system seems to be outdated as well.
@oFox_
@oFox_ 3 жыл бұрын
ctrl s am i joke to you
@thewindowgames2610
@thewindowgames2610 3 жыл бұрын
Dang, I hate when that happens
@kieranwiggy2522
@kieranwiggy2522 4 жыл бұрын
Everyone is back here since we are all in quarantine
@Dom4321
@Dom4321 4 жыл бұрын
Hell Yeah
@unclerandy398
@unclerandy398 4 жыл бұрын
yup
@voicehead
@voicehead 4 жыл бұрын
oh yeah
@julianeyt4059
@julianeyt4059 4 жыл бұрын
after this is over we will have millions of new game developer XD
@aquah2080
@aquah2080 4 жыл бұрын
TF, i just realized i got inspired for gamemaking just because i have too much time with my laptop since the quarantine. Thank you for opening my eyes
@rasmuus10
@rasmuus10 5 ай бұрын
This tutorial has helped me so much. Everything works perfectly
@taylor_3d
@taylor_3d Жыл бұрын
That's the gravy! Finally found an answer to the isGrounded issue! Great job!
@xrotator8986
@xrotator8986 4 жыл бұрын
me: *watches the video 5 separate times and remembers something* me again : *types it before brackeys says anything about it* my brain : I am five universes ahead of you
@h.k654
@h.k654 3 жыл бұрын
Can anyone help me?Whenever I press spacebar the player doesnt do anything.I can move and look around though.
@FaruukNN
@FaruukNN 3 жыл бұрын
@@h.k654 you should check your groundcheck :d
@connorkerrigan3582
@connorkerrigan3582 4 жыл бұрын
i laughed so hard when my guy slowly started floating up into the sky
@rexss90
@rexss90 4 жыл бұрын
i have the same problem, can't seem to get the guy on the ground. He either shoots sideways extremely fast or floats
@nautics9927
@nautics9927 4 жыл бұрын
@@rexss90 go into your player and make sure the gravity is negative
@rexss90
@rexss90 4 жыл бұрын
@@nautics9927 Thanks, i figured it out finally!
@CrazyJoven
@CrazyJoven 4 жыл бұрын
@@nautics9927 THANK YOU!!
@nautics9927
@nautics9927 4 жыл бұрын
@@CrazyJoven no problem
@Aragos207
@Aragos207 Жыл бұрын
Thanks Brackeys, really good explaining everything!
@MemesChannel7531
@MemesChannel7531 8 ай бұрын
The Fact That I Learned 3D Movement Script. YOU ARE JUST AWESOME
@AAlecs
@AAlecs 3 жыл бұрын
me: I will do this by myself also me at 12 am: Brackeys tutorial fps movement
@labscience8271
@labscience8271 3 жыл бұрын
Hahahha same. I'm a noob. I can't do it without Brackeys
@cubecraftgaming9669
@cubecraftgaming9669 2 жыл бұрын
@@labscience8271 Im pretty good at coding, so I tried myself, but 2 days later, 7 cups of coffee drank, and a dead heart, I came to this and it worked! 😁
@datblue1104
@datblue1104 3 жыл бұрын
Brackeys: "And now we should be able to move around" My Character: " *_YEET gdf bngrsdts ytnw eaygfdfgbv_* "
@eddybplayz4801
@eddybplayz4801 3 жыл бұрын
@DRAGO YT GAMING using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public CharacterController controller; public float speed = 50f; public float gravity = -9.81f; Vector3 velocity; // Update is called once per frame void Update() { float x = Input.GetAxis("Horizontal"); float z = Input.GetAxis("Vertical"); Vector3 move = transform.right * x + transform.forward * z; controller.Move(move * speed * Time.deltaTime); velocity.y += gravity * Time.deltaTime; controller.Move(velocity * Time.deltaTime); } } paste this in mate, see if it works. i think you might need to change a bit tho
@aheavyofculture
@aheavyofculture 3 жыл бұрын
@DRAGO YT GAMING Why do you use a capital at the start of every word?
@nutellacheese6017
@nutellacheese6017 3 жыл бұрын
Lolol
@user-ji3tc7ut8k
@user-ji3tc7ut8k 3 жыл бұрын
@@aheavyofculture C# is cap sensitive
@aheavyofculture
@aheavyofculture 3 жыл бұрын
@@user-ji3tc7ut8k so?
@mjdragon13
@mjdragon13 2 жыл бұрын
For those who dont seem to have the jump or the collider logic working... Try using this logic for the ground check... // Ground Check Logic isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask.value); if(isGrounded && velocity.y < 0) { velocity.y = 0f; } The only change here is the addition of .value to the groundmask param in Checksphere...it did the trick for me 😊
@jmdbeans
@jmdbeans Жыл бұрын
sorry it didnt work for me
@Tryftz
@Tryftz Жыл бұрын
Thank you so much Brackeys, your videos are very awesome and helpful and you explain very well what your teaching your students ♥
@markiyeee
@markiyeee 4 жыл бұрын
me: following every step he makes The Word/letter color: is different me: there's something wrong I can feel it
@mage3690
@mage3690 4 жыл бұрын
Could be the highlight settings. Those have probably changed in the many updates since then. Unless it's not highlighting at all, in which case you or someone has turned them off, or the code straight up doesn't work.
@nevetsmahgnirtle8961
@nevetsmahgnirtle8961 4 жыл бұрын
The way I do these tutorials is to watch them a couple of times then enter the script line by line, compiling and running as I go. He has a bewildering habit of backtracking and adding code later on which some may find instructive (not me). I wait 'til the whole script is there then enter each line and test it. Voila! No errors!
@Gregory_12
@Gregory_12 4 жыл бұрын
imagine A third-person game, but it's a first-person game
@isaacsworld1177
@isaacsworld1177 4 жыл бұрын
😒
@oscarfacecamplz8264
@oscarfacecamplz8264 4 жыл бұрын
If it in color. What happens I’m new to Unity please help me it says when I hit play remove the compiler errors.
@MidasClutch
@MidasClutch 3 жыл бұрын
Me- follows instructions carefully and does everything he says Unity- 1 error: please delete unused term “mouseY Me- removes mouseY Unity- 1 error: please add “mouseY Me- *dies*
@holliscf
@holliscf 3 жыл бұрын
Space in btw mouse and Y?
@learnenglishinhouse3102
@learnenglishinhouse3102 3 жыл бұрын
error because the space, is "Mouse Y"
@sohamacharya171
@sohamacharya171 3 жыл бұрын
A catch 22 situation.
@fillament
@fillament 2 жыл бұрын
That happens too much.
@sylinder__2633
@sylinder__2633 2 жыл бұрын
personally it says i have to setup mouse x but i dont know how to do it
@DanyVeilleux
@DanyVeilleux Жыл бұрын
thanks brackeys you're the best for showing us that. seriously thank you
@gaurang3586
@gaurang3586 2 жыл бұрын
YOUR ASSETS ARE AWESOME JUST LIKE YOUR TUTORIALS
@susseratal
@susseratal 4 жыл бұрын
7:26 I love how you can learn how to not tie framerates to game speed in the first tutorial on indie development, but Bethesda couldn't do that in their fully priced, AAA title
@Lumiobyte
@Lumiobyte 4 жыл бұрын
@@speedyturtle1537 why are you spamming that everywhere
@user-un5xj1wl6p
@user-un5xj1wl6p 4 жыл бұрын
Idk... they have much bigger problems... like they aren't even using an engine comparable to unity... it's more comparable to quake ...
@jamieboer3466
@jamieboer3466 4 жыл бұрын
Its much different in Unity vs other engines, plus for larger games they generally have to create their own solutions for this anyway as a lot of unity's solutions are not perfect.
@user-un5xj1wl6p
@user-un5xj1wl6p 4 жыл бұрын
@@jamieboer3466 yeah no solution is perfect... but bethesda's cration engine is... an artefact... their previous gamebryo was so-sk back then... but gamebryo is not aimed at modern AAA
@Lmao-ke9lq
@Lmao-ke9lq Жыл бұрын
the most funny thing is, that by multiplying mouseX/Y by Time.DeltaTime actually makes sensitivity frame rate dependent, because its already done by default, so this video is wrong, you can test it by setting framerate to 10 fps and then to 1000 fps and see that sensitivy is different if you multiple by Time.DeltaTime, remove it
@labscience8271
@labscience8271 3 жыл бұрын
Major parts for quick access: 00:01 - 02:49 Intro & Explanation 02:50 - 10:40 Camera Movement & Look around 10:41 - 22:50 Player Movement & Gravity 22:50 - 23:50 Outro Thank you Brackeys I miss you :(
@Boogaloo69
@Boogaloo69 2 жыл бұрын
Same bro :(
@frostblock_12
@frostblock_12 2 жыл бұрын
thanks my dude
@MMithy
@MMithy 2 жыл бұрын
@@Boogaloo69 same :(
@yourmum69_420
@yourmum69_420 2 жыл бұрын
hey can anyone help me please? When I added controller support my camera spins around like crazy and I don't know why
@Bigmanjeff69
@Bigmanjeff69 2 жыл бұрын
Thanks for this bro
@Deadcatconversation
@Deadcatconversation Ай бұрын
Thanks this tutorial is exacly what i was lookig for a simple and customizable playerController
@sofiaonaga5352
@sofiaonaga5352 Жыл бұрын
I optomized it for the new input system and it works great!
@MathRavn
@MathRavn 3 жыл бұрын
This is the most relatable comment section I've ever seen
@akki3535
@akki3535 3 жыл бұрын
I agree lol
@oakamaam
@oakamaam 3 жыл бұрын
reletable :0
@MathRavn
@MathRavn 3 жыл бұрын
@@oakamaam ?
@bumewsa1483
@bumewsa1483 3 жыл бұрын
BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM BUM
@foshe
@foshe 3 жыл бұрын
Hi hi, im no
@georgebooth6441
@georgebooth6441 3 жыл бұрын
Me: Gravity doesn't work. Me: "Alright I'll continue in about 3 years,"
@tinsku332Xd
@tinsku332Xd 3 жыл бұрын
@Torben Kauth it worked for me
@jayjayjay-er9ex
@jayjayjay-er9ex 3 жыл бұрын
@@tinsku332Xd i can't get it to work. whenever i jump it doesn't work and turns off the gravity. any tips or code i could use?
@tinsku332Xd
@tinsku332Xd 3 жыл бұрын
@@jayjayjay-er9ex this should work using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public CharacterController controller; public float speed = 12f; public float gravity = -9.81f; public float jumpHeight = 3f; public Transform groundCheck; public float groundDistance = 0.4f; public LayerMask groundMask; Vector3 velocity; bool isGrounded; // Update is called once per frame void Update() { isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask); if(isGrounded && velocity.y < 0) { velocity.y = -2f; } float x = Input.GetAxis("Horizontal"); float z = Input.GetAxis("Vertical"); Vector3 move = transform.right * x + transform.forward * z; controller.Move(move * speed * Time.deltaTime); if(Input.GetButtonDown("Jump") && isGrounded) { velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity); } velocity.y += gravity *Time.deltaTime; controller.Move(velocity * Time.deltaTime); } }
@jayjayjay-er9ex
@jayjayjay-er9ex 3 жыл бұрын
@@tinsku332Xd thank you sososososososososo much
@jayjayjay-er9ex
@jayjayjay-er9ex 3 жыл бұрын
@@tinsku332Xd i copied and pasted your code but no luck. same as before :(
@pringl3
@pringl3 7 ай бұрын
YESSS TYSM FOR THIS, my one finally worked after try about 5 other tutorials
@Whopper3
@Whopper3 2 жыл бұрын
Thank you so much. This helps me fine a starting point and commit to making a game
@magicdragon3725
@magicdragon3725 3 жыл бұрын
When you're like, "What's wrong, nothing is showing up" but you forgot to save.
@kylu5416
@kylu5416 3 жыл бұрын
Or when you forgot to put a semicolon at the end of a line of code
@thespeediestgonzales7704
@thespeediestgonzales7704 3 жыл бұрын
@@kylu5416 or when you accidentally write code after a semicolon and leave it there in addition to a semicolon at the end
@alphaa2182
@alphaa2182 3 жыл бұрын
@@thespeediestgonzales7704 Or when you forgetting the multiplication dash adjacent to the vector
@willgamer101dondon7
@willgamer101dondon7 3 жыл бұрын
THAT WAS MY ISSUE THANK YOU SO MUCH
@magicdragon3725
@magicdragon3725 3 жыл бұрын
@@willgamer101dondon7 np
@kingkodo7184
@kingkodo7184 4 жыл бұрын
Decent tutorial to get beginners started in the right direction. However, there are at least 2 things i think you should have addressed! 1.) Trying to jump onto something can cause a stutter/jitter effect because the slope limit(it should be adjusted when you jump and then readjusted when you land) and 2.) If an object is above the character when they jump, the character will still jump and continue to move against the object.(This would have been a good time to introduce collision flags) EDIT: Also, the movement vector isn't normalized, resulting in an increased speed if moving at a diagonal angle.
@Brackeys
@Brackeys 4 жыл бұрын
Definitely agree that these additions would make the character controller even more solid! I didn't encounter these problems in my test scene but I can of course see cases where this would be good to add :-) Thanks for pointing this out so that people can add this to their scripts!
@tamaskisely9122
@tamaskisely9122 4 жыл бұрын
Could somebody please be more specific? ( I mean explain this in a more detailed way) Thanks
@equation1321
@equation1321 4 жыл бұрын
Hello
@llakuawyus7326
@llakuawyus7326 4 жыл бұрын
@@tamaskisely9122 Yeah a bit more detail would help a lot lol.
@TheCivildecay
@TheCivildecay 4 жыл бұрын
How do you normalize the movement so it takes in diagonal movement? If I just normalize the move vector3 it will cause my movement to act slidy (player still moves a bit when releasing the movement buttons)
@ThunderPlayStudios
@ThunderPlayStudios 2 жыл бұрын
in love with your tutorials man
@bigusdickus7866
@bigusdickus7866 3 жыл бұрын
Me: sees different colours in the script on my screen than his screen Also me:I recon this ain't workin
@Charduza
@Charduza 3 жыл бұрын
lol different colors dont matter
@bigusdickus7866
@bigusdickus7866 3 жыл бұрын
@@Charduza I am boomer, I feel embrassed
@jacobmars1902
@jacobmars1902 3 жыл бұрын
@@bigusdickus7866 I used to think that as well, don’t worry
@tryfle3461
@tryfle3461 3 жыл бұрын
For some reason it won't let me code do you know why that is? Do I have to download something other than unity?
@jacobmars1902
@jacobmars1902 3 жыл бұрын
@@tryfle3461 download the unity tools package for your IDE
@zimistic6680
@zimistic6680 3 жыл бұрын
“Man coding is so easy and works every time!” -nobody on planet earth
@jacobjackson8619
@jacobjackson8619 3 жыл бұрын
if i hear anyone say this, i smack their face with the errors i got in the last 5 mins
@doge7831
@doge7831 3 жыл бұрын
I got 999+ errors in 5 minutes of coding.
@noamyairperelman875
@noamyairperelman875 3 жыл бұрын
@@doge7831 me to
@ruddydd4085
@ruddydd4085 3 жыл бұрын
truth :p
@lightbulb8888
@lightbulb8888 3 жыл бұрын
its actually ez and i didn't get any erro
@luketabois2620
@luketabois2620 2 жыл бұрын
so glad they left all their videos up the gravity code helped me out big time
@AndyGun11
@AndyGun11 Жыл бұрын
Thank you Brackeys! I just started Unity, and these tutorials are amazing! :DD
@McCrazyDude950
@McCrazyDude950 Жыл бұрын
if you finished the code and it worked, quick question: im at 9:40 in the video and im getting a few errors on line 27 (xRotation Mathf.Clamp(xRotation, -90f, 90f); ). when i save the script to unity, it tells me that ; and a , have to be placed some where, and i found where i needed to put it, but it gave even more errors. did line 27 work for you?
@McCrazyDude950
@McCrazyDude950 Жыл бұрын
if it did, please tell me what i couldve done wrong
@AndyGun11
@AndyGun11 Жыл бұрын
@@McCrazyDude950 uh.. My best advice here is to just restart the tutorial.
@LegndGames_YT
@LegndGames_YT 4 жыл бұрын
Great tutorial as always! I might be wrong, but I think you are making a misstake by applying delta time to the mouse input. The reason for this is that the mouse input you are receiving is already a delta value.. It is already the amount you have moved that frame! The mouse is an asynchronous input device. So it's position value already changes over time, not per frame! Upvote for awareness :) Also if I'm wrong with any of my claims, please let me know for my own educational purpose. Peace!
@pepijnvb1484
@pepijnvb1484 4 жыл бұрын
Thanks for the tip, it removed the stuttering for me!
@LegndGames_YT
@LegndGames_YT 4 жыл бұрын
@@pepijnvb1484 No problem! Glad to help :)
@karter6632
@karter6632 4 жыл бұрын
@@LegndGames_YT how do i do this
@karter6632
@karter6632 4 жыл бұрын
@@LegndGames_YT how do i do this
@LegndGames_YT
@LegndGames_YT 4 жыл бұрын
@@karter6632 Simply remove Time.deltaTime from the MouseLook script :)
@bagger1451
@bagger1451 2 жыл бұрын
Me: Copys his code perfectly Unity: 341 Errors Me: Adds 1 letter Unity: Perfect.
@lcj3_
@lcj3_ 2 жыл бұрын
fax man me: **Forgets to put a semicolon** Unity: This semicolon will ruin your life now.
@Ikaros-fo5cb
@Ikaros-fo5cb 2 жыл бұрын
for some reason the script for the mouselook doesn't work on my "game" what do i do?
@FelineRaptor-gv4te
@FelineRaptor-gv4te 2 жыл бұрын
@@lcj3_ but your IDE will point out where you missed the semi colon
@lcj3_
@lcj3_ 2 жыл бұрын
@@FelineRaptor-gv4te i accidentally wrote an # in the middle of the code without even realizing and it took me 2 hours to find me that p.........
@lcj3_
@lcj3_ 2 жыл бұрын
@@FelineRaptor-gv4te unity didn't even tell me where the error of the code was, it was pointing to something that i wrote correctly, when i removed the #, everything worked perfectly
@Cold_soup._.
@Cold_soup._. Жыл бұрын
This genuinely helped so much fr
@kahuisswag
@kahuisswag 11 ай бұрын
The video we've all needed at one point
@alariccollado3236
@alariccollado3236 2 жыл бұрын
If anyone is having issues with the line involving "MathF", its "Mathf" now. Hope this helps!
@alexbrooks128
@alexbrooks128 2 жыл бұрын
@nostalgia television just tryna help bro chill
@cakedon
@cakedon 2 жыл бұрын
That one Unity programmer that changed MathF to Mathf and earned 1000$ for it
@psytf2
@psytf2 2 жыл бұрын
@nostalgia television sounds like you're trying to sound smart
@jacobfenech7662
@jacobfenech7662 4 жыл бұрын
My brain when I am a 13 year old boy and just started programming: Just copy everything and it'll work. You don't have to understand the code. (2 seconds later) Unity: You have to fix compiled errors. Me: Time for new project.
@salemisjuucy
@salemisjuucy 4 жыл бұрын
I'm thirteen and it's pretty simple, make sure your line of code is in between an opening and closing bracket, make sure there are no spelling errors, and maybe just learn the basics of c# like i did
@Just_Cat.
@Just_Cat. 4 жыл бұрын
same
@InsaneJumpscare
@InsaneJumpscare 4 жыл бұрын
@@salemisjuucy compiled errors
@NielsKnives
@NielsKnives 4 жыл бұрын
I m 12 and i get it
@InsaneJumpscare
@InsaneJumpscare 4 жыл бұрын
N M video's but it still has errors, am I using the wrong coding app? I am using c# visual studio
@arkilusreal
@arkilusreal 2 жыл бұрын
for whoever needs it, at 10:30, if you are having problems and your mouse is moving very little, go into Main Camera, go on the right side where it says Inspector and go down to the bottom to where it says Mouse Sensitivity and change that to 1000 or how much you are comfortable with. you're welcome
@etannn
@etannn 2 жыл бұрын
Thanks bro
@arkilusreal
@arkilusreal 2 жыл бұрын
@@etannn no probs
@DiegoValenciabajista
@DiegoValenciabajista Жыл бұрын
Ey bro, my cursor is still visible even tho I put the Cursor code at the start void. Do you know why?
@arkilusreal
@arkilusreal Жыл бұрын
im so sorry dude i watched this like a month ago so i have no idea lol. But ill try to find out why
@DiegoValenciabajista
@DiegoValenciabajista Жыл бұрын
@@arkilusreal its ok, actually I figure it out. Thank you very much for responding!
@JakeB0079
@JakeB0079 Жыл бұрын
This is the first camera rotation script ive seen work ive sifted thru script and youtube vids for hours for this. hopefully the player movement is as easy!
@sykoo
@sykoo 4 жыл бұрын
That terrain in the thumbnail is 10/10! Thought it was RTX Minecraft, then it started looking like a delicious cake with moss on top of it :P Also, welcome back my dude!
@theonlyasher
@theonlyasher 3 жыл бұрын
Sykooooooooooooooooooo
@thecomputez-gaming8427
@thecomputez-gaming8427 3 жыл бұрын
@AlanTheGamerWolf wdym sykoo is lit
@age9502
@age9502 3 жыл бұрын
Only 3 comment
@iantakacs8771
@iantakacs8771 3 жыл бұрын
mmmm moss cake
@jeremiahruiz9686
@jeremiahruiz9686 3 жыл бұрын
the best level creator
@viola_case
@viola_case 2 жыл бұрын
Brackeys tutorials will always be my go-to because his smile makes me feel welcome and ready to learn.
@josephjohn9215
@josephjohn9215 2 жыл бұрын
my camera is not rotating instead player is moving in the x axis when i move the mouse, what do i do
@viola_case
@viola_case 2 жыл бұрын
@@josephjohn9215 I think you meant to put this in the main video thread? I don't know how to fix your problem.
@josephjohn9215
@josephjohn9215 2 жыл бұрын
@@viola_case thank you, but someone else helped me
@Couldbeme
@Couldbeme 2 жыл бұрын
@@josephjohn9215 what'd they say
@josephjohn9215
@josephjohn9215 2 жыл бұрын
@@Couldbeme I didn't put the main camera in the playerlookscript in the inspector so it moved the player instead of the camera ( I think )
@klaus-wd6en
@klaus-wd6en 2 жыл бұрын
Brackeys you are the best game dev ever cuz u teach it to us. I am inspired by you and wanna make a game which everyone can enjoy:D
@mesopithecus8622
@mesopithecus8622 2 жыл бұрын
Little late, but here is a way you can add Sprint: Set speed to a private variable with no value.(private float speed;) Add something like: public float runSpeed = 20f; public float walkSpeed = 12f; (You don't have to use these values, change them to what you want.) if(Input.GetButton("")) { speed = runSpeed; } else { speed = walkSpeed; } Note that you can also use Input.GetKey, but I prefer GetButton(as it gives you lets you do more, and because it is then really easy to remap controls) Hope this helps.
@user-er3kw8hv7i
@user-er3kw8hv7i 2 жыл бұрын
whats the key for left shift?
@mesopithecus8622
@mesopithecus8622 2 жыл бұрын
@@user-er3kw8hv7i You could use GetKey(KeyCode.LeftShift) But I recommend going to the input manager and setup a left shift button. You could look up a tutorial online, or if you can't find one i could make on for you
@Ze_N00B
@Ze_N00B Жыл бұрын
@@user-er3kw8hv7i it's "left shift". Go into Edit>Manage Settings > Input Manager, expand the axis limit, rename the newest axis to "Sprint" or what have you, then input "left shift" where the positive action is. Then write the name "Sprint" in your code to have it use it.
@NotMrLex
@NotMrLex Жыл бұрын
thank you very kind stranger.
@sohodollie7643
@sohodollie7643 Жыл бұрын
You can also check if the character is grounded. If the character is grounded, change speed = runSpeed and deplete a stamina bar, if the character is in the air, dont change speed at all. you could also add a "dash" button that increases horizontal velocity in the forward direction to let you dash mid-air
@breadnotseen4292
@breadnotseen4292 3 жыл бұрын
I know this will probably get buried and that this is kinda common knowledge but I found out how to add sprint! if (Input.GetKey("left shift") && isGrounded) { speed = 20f; } else { speed = 12f; }
@MimsTwo
@MimsTwo 3 жыл бұрын
Thanks!
@wolfster7776
@wolfster7776 3 жыл бұрын
Amazing it is working Tx
@poizan8460
@poizan8460 3 жыл бұрын
you shouldn't add the && isGrounded, since sprinting make's you jump abit further ahead! Just saying though ;)
@wolfster7776
@wolfster7776 3 жыл бұрын
ohh
@MachStarry
@MachStarry 3 жыл бұрын
Worst mechanics in games when you could let the player be free of not holding the button even when theres no stamina as a resource and on top of that you aren't able to shoot
@tres-2b299
@tres-2b299 2 жыл бұрын
I used this tutorial just to know how to rotate and actually make the player move, i have all the new input system stuff already with mobile joystick, and it worked!
@Super_Nova919
@Super_Nova919 Жыл бұрын
This Helped me so much, you deserve a subscribe :)
@joeyestrada9071
@joeyestrada9071 6 ай бұрын
You're literally the best at showing us this stuff. It's a shame you don't make videos anymore...
@RichWilx
@RichWilx 3 жыл бұрын
Good tut! The physics stuff is cool and it's interesting to see how "real" physics isn't quite what we expect in games.
@TheAmazingPyro99
@TheAmazingPyro99 3 жыл бұрын
me: copys all of the code perfectly unity: ERROR also me: changes from a capitalised T to an normal t Unity: no errors
@superlative_
@superlative_ 3 жыл бұрын
let me guess. transform and Transform?
@jangamer2971
@jangamer2971 3 жыл бұрын
Lmao I was seraching for answers in comments to help me you were the one I just replaced the T with a t
@TheAmazingPyro99
@TheAmazingPyro99 3 жыл бұрын
@@jangamer2971 bruh
@Larss_J
@Larss_J 3 жыл бұрын
I have the same problem
@Yoctopory
@Yoctopory 3 жыл бұрын
So in fact you DIDN'T copy the code perfectly ;)
@Blue_Fox_Plays
@Blue_Fox_Plays Жыл бұрын
Thank you so much for this tutorial! it helped me a lot!
@nofch247
@nofch247 2 жыл бұрын
Your a life saver thank you so much for all the help you are putting in for my game
@bahaniieverett6475
@bahaniieverett6475 Жыл бұрын
noch?
@WextraYT
@WextraYT Жыл бұрын
@@bahaniieverett6475 n o c h
@bahaniieverett6475
@bahaniieverett6475 Жыл бұрын
@@WextraYT nice
@boysminecraftianos469
@boysminecraftianos469 4 жыл бұрын
Me yesterday: Well, I'm gonna take part of a GameJam from my programming school, so I think I'll do a 3D First-Person Survival Game. *And I want to do as much as possible alone, not copying code or getting stuff from the internet* Me after taking a look at this video: The hell are quaternions? Me after searching about it: I'd better copy some code
@talibalasrar
@talibalasrar 4 жыл бұрын
Everyone copies code at first you will learn gradually over time
@davidfails2866
@davidfails2866 4 жыл бұрын
Haha... Explain them to me im too lazy to look them up
@linshu6141
@linshu6141 4 жыл бұрын
Most of the time u will copy code anyway. Just putting it together and make a final and unique game out of it is the difficult part. Of course u will learn over time the basics that u often use but i promise you u can't learn everything.
@itzyuzuruclips
@itzyuzuruclips 4 жыл бұрын
lol I'm working on a game with my grp and I'm at the same stuff 😂😂 Now imma copy some movements and aim codes
@icantthinkofaname2722
@icantthinkofaname2722 4 жыл бұрын
You don't need to know how Quaternions work to utilise their implementation. Tbh you wouldn't even need to know how they work to implement them yourself (even if it would certainly be helpful).
@raffe7889
@raffe7889 3 жыл бұрын
I can't believe Brackeys is gone ;_; Their content is still amazing though and they made A LOT of it
@TheCorruptClown32518
@TheCorruptClown32518 3 жыл бұрын
Wut happened
@DemonPig666
@DemonPig666 3 жыл бұрын
😭😭
@FuzzyWeasel
@FuzzyWeasel 3 жыл бұрын
I know.its sad. But I think codeMonkey still makes videos. You could check him out
@emirhansoyluBF
@emirhansoyluBF 3 жыл бұрын
I'm still crying :''''(((((
@faisalalodat9037
@faisalalodat9037 3 жыл бұрын
:(
@napoleon384
@napoleon384 2 жыл бұрын
man i always wanted to make games and u are best teacher that i could've asked for, everything is detailed and easy to understand. i always thought that gamedev was hard but then i found u. thank a lot
@gregorvalusso629
@gregorvalusso629 2 жыл бұрын
You helped me a lot. Thanks so much!
@no8053
@no8053 3 жыл бұрын
One of the most satisfying parts about coding is when you successfully debug something eventhough it was just a small error like forgetting one cast or something
@bobsapdagger
@bobsapdagger 3 жыл бұрын
Gotta say there's nothing quite as satisfying as successfully debugging; it's a mountain of negativity instantly lifted, no more errors, no more red squiggly lines, no more self doubt you don't even care that it was something really stupid, it still feels good.
@eeevoo
@eeevoo 3 жыл бұрын
couldn't have said it better
@marcusaddison8866
@marcusaddison8866 3 жыл бұрын
Out ranks all those satisfying video compilations on KZfaq
@h.k654
@h.k654 3 жыл бұрын
Can anyone help me? I have a problem where I cant jump even though I copied the exact code.
@eeevoo
@eeevoo 3 жыл бұрын
@@h.k654 Did you assign the script to the player?
@h.k654
@h.k654 3 жыл бұрын
​@@eeevoo Yes.
@Enderia2
@Enderia2 Жыл бұрын
I love how the second result for 1st person movement unity is a video which doesn’t work when recreating it exactly 7 months ago, and this is from 2 years ago, simple, and works.
@Mojzer_
@Mojzer_ 2 жыл бұрын
yoo this actually helped me, TYVM!
@nicolaicardinale7902
@nicolaicardinale7902 3 жыл бұрын
It's 2021 and this video is still a GODSEND. thank you so much for not just good instructions but clear ones.
@Semmetje11lolly
@Semmetje11lolly 3 жыл бұрын
2:49 video starts here (for myself, because I'll be coming back here A LOT)
@thunderbear06playsstuff63
@thunderbear06playsstuff63 3 жыл бұрын
Well you could export the player as a package so that you can import it into more projects in the future
@thunderbear06playsstuff63
@thunderbear06playsstuff63 3 жыл бұрын
thats what im trying to do rn
@matthewsimpson796
@matthewsimpson796 3 жыл бұрын
Thanks?
@timmy21r
@timmy21r 3 жыл бұрын
@@thunderbear06playsstuff63 How do you do that?
@thunderbear06playsstuff63
@thunderbear06playsstuff63 3 жыл бұрын
@@timmy21r This should be what your looking for docs.unity3d.com/Manual/AssetPackagesCreate.html hope that helps
@gamingtech4973
@gamingtech4973 10 ай бұрын
Thanks a ton. Only video to help me
@odysseaskorelides7897
@odysseaskorelides7897 6 ай бұрын
i really adore your effort to teach us...
@davidmcasas
@davidmcasas 3 жыл бұрын
Hi, I wanted to share a tip since I believe something may not be 100% correct in this tutorial. I followed it through, in Unity 2019.4 with the same script you wrote and got it to work, however, I noticed that when I tried to jump pushing against a wall, the jump was jittery and incomplete in height. After much headache and a lot of googling, I found out that CharacterController may act weird if you call the Move function more than once within an Update function. In your script you are calling it twice: one for the X and Z movement, and other for the vertical movement. I believe that the right way to do it is to just call it once, with a single Vector3 that combines the 3 directions. I did it this way and the jitter stopped and everything's fine. So I recommend anyone who has any problem to try to call the Move function just once. However, to do this, you need to multiply the speed before, and not within the Move call, because you don't want the plain speed to have effect on the vertical movement: Vector3 move = transform.right * x * speed + transform.forward * z * speed + transform.up * verticalVelocity; controller.Move(move * Time.deltaTime); Please note that I'm new to Unity and still learning, however this worked for me and fixed the jittering while maintaining the same functionality, I hope it helps.
@aresstavropoulos916
@aresstavropoulos916 3 жыл бұрын
Damn I love u I was about to give up and saw your comment.
@kyledunbar9255
@kyledunbar9255 3 жыл бұрын
you legend. came back to the comments just to see if anyone had a fix for this
@blasfah1909
@blasfah1909 3 жыл бұрын
vertical velocity does not exist in the current context
@davidmcasas
@davidmcasas 3 жыл бұрын
@@blasfah1909 sorry my "verticalVelocity" is a float which corresponds to "velocity.y" in the video, I just used a float instead of a vector3 for the jump since I noted that he was only using one axis of that vector3
@Daniel-qf6kz
@Daniel-qf6kz 3 жыл бұрын
@@davidmcasas hey dude im a very new programmer i keep getting this error if u want could u help me fix it? Assets\scripts\PlayerMovement.cs(10,28): error CS0266: Cannot implicitly convert type 'double' to 'float'. An explicit conversion exists (are you missing a cast?) heres my code using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public CharacterController controller; public float speed = 12f; public float gravity = -9.81; Vector3 velocity; // Update is called once per frame void Update() { float x = Input.GetAxis("Horizontal"); float z = Input.GetAxis("Vertical"); Vector3 move = transform.right * x * speed + transform.forward * z * speed + transform.up * velocity.y; controller.Move(move * Time.deltaTime); velocity.y += gravity * Time.deltaTime; } }
@suspense_comix3237
@suspense_comix3237 3 жыл бұрын
I spent 30 minutes on trying to get the camera to rotate when I figured out I needed to save my code. I D I O T LOL
@aravind.s1187
@aravind.s1187 3 жыл бұрын
lool
@greenappleplaysroblox1661
@greenappleplaysroblox1661 3 жыл бұрын
How do you save it
@suspense_comix3237
@suspense_comix3237 3 жыл бұрын
@@greenappleplaysroblox1661 Ctrl + S
@greenappleplaysroblox1661
@greenappleplaysroblox1661 3 жыл бұрын
Suspense_Comix thank you
@aravind.s1187
@aravind.s1187 3 жыл бұрын
@@greenappleplaysroblox1661 lol
@kabirshingh7521
@kabirshingh7521 Жыл бұрын
Thanks so much, sir! It helped me a lot in learning Unity I am a beginner so it is helpful for me and easy to understand BTW new sub 😃
@kaclifs8199
@kaclifs8199 Жыл бұрын
i'm a beginer dev and i watch our videos and i realy evolute.detail 12 years
@henrylawrence8562
@henrylawrence8562 4 жыл бұрын
Just a tip to beginner programmers on C# from a beginner programmer with C#: use the unity scripting API. It's an online Unity "Dictionary" and explains a lot of the built in Unity functions. Use. It. Especially if you do not understand any words or functions because of a lack of knowledge, which is normal, but just know that this is a very good help.
@equation1321
@equation1321 4 жыл бұрын
Henry Lawrence thnx
@kajunia6960
@kajunia6960 4 жыл бұрын
Brackeys: And that should be it for our basic movement. If we now save this, and go back to Unity- Me: We get a bunch of errors and lose all hope!
@tealsheepproductions7431
@tealsheepproductions7431 4 жыл бұрын
me too
@natharon
@natharon 4 жыл бұрын
lmao yes
@coffeeandpie1480
@coffeeandpie1480 4 жыл бұрын
yes
@discodude917
@discodude917 4 жыл бұрын
you gotta save the project
@bigmantunes
@bigmantunes 4 жыл бұрын
so true
@Iamaqwerte
@Iamaqwerte Жыл бұрын
Thanks so much, I can finally start a project that I can publish!
@killeroblivin
@killeroblivin Ай бұрын
Im glad i found this video so i could yoink your grounded detection
@thesixstistari5604
@thesixstistari5604 3 жыл бұрын
Every time he says "it's actually really simple" he just feels like unityes Mumbo-jumbo With the difference that I am good at Redstone, but my programming knowledge is less then 0
@cubecraftgaming9669
@cubecraftgaming9669 2 жыл бұрын
Same with me, but I'm good at programing but trash at redstone
@owleyed5038
@owleyed5038 2 жыл бұрын
(Not so) Same problem here trash at both like I know nothing.
@chilfghfh1949
@chilfghfh1949 2 жыл бұрын
@@owleyed5038 Ah it seems I have found my twin.
@lakshyakumar4459
@lakshyakumar4459 2 жыл бұрын
yeah Brackeys in Codin = MubmoJumbo in Redstone (Ablolute gods)
@Antrixxmb
@Antrixxmb 2 жыл бұрын
im trash at redstone, and im trash at programming.
MAKE AN RPG WITHOUT CODE - Unity Creator Kit
24:18
Brackeys
Рет қаралды 467 М.
Shooting with Raycasts - Unity Tutorial
13:41
Brackeys
Рет қаралды 1,8 МЛН
Indian sharing by Secret Vlog #shorts
00:13
Secret Vlog
Рет қаралды 56 МЛН
ХОТЯ БЫ КИНОДА 2 - официальный фильм
1:35:34
ХОТЯ БЫ В КИНО
Рет қаралды 2,6 МЛН
Шокирующая Речь Выпускника 😳📽️@CarrolltonTexas
00:43
Глеб Рандалайнен
Рет қаралды 9 МЛН
Teaching A.I. to Play my Game!
10:45
Dani
Рет қаралды 3,3 МЛН
I Accidentally Made an Evil Robot my Friend
12:51
Dani
Рет қаралды 7 МЛН
Unity FPS Movement Tutorial by Dani  |  Karlson Parkour FPS Controller
8:36
DanisTutorials
Рет қаралды 1,1 МЛН
3 Devs Make An FPS - Godot vs Unity vs Unreal || GameDev Battles
12:39
He said I Couldn't Make a 3D Game... So I Made One!
10:29
Dani
Рет қаралды 9 МЛН
The Strange Graphics Of LETHAL COMPANY
15:59
Acerola
Рет қаралды 663 М.
I Used Godot For 100 Hours, Here’s What I Learned
35:09
LazyAlarm
Рет қаралды 1,1 МЛН
THIRD PERSON MOVEMENT in Unity
21:05
Brackeys
Рет қаралды 1,4 МЛН
Indian sharing by Secret Vlog #shorts
00:13
Secret Vlog
Рет қаралды 56 МЛН