How to make a Video Game in Unity - CAMERA FOLLOW (E04)

Sdílet
Vložit
  • čas přidán 14. 02. 2017
  • Let's make our camera follow our player!
    ● Download scripts, assets and project files for this course: devassets.com/assets/how-to-ma...
    ❤️ Donate: www.paypal.com/donate/?hosted...
    ····················································································
    This video is part of a mini-series on making your first game in Unity.
    ····················································································
    ► Join Discord: / discord
    ♥ Subscribe: bit.ly/1kMekJV
    ● Website: brackeys.com/
    ● Facebook: / brackeys
    ● Twitter: / brackeystweet
    ········································­­·······································­·­····
    ► All content by Brackeys is 100% free. I believe that education should be available for everyone. Any support is truly appreciated so I can keep on making the content free of charge.
    ········································­­·······································­·­····
    ♪ Baby Plays Electro Games
    teknoaxe.com/cgi-bin/link_code...

Komentáře • 2,5K

  • @Brackeys
    @Brackeys  Před 7 lety +1095

    Hey guys! I'm glad you guys are liking the series so far :)
    I try to put as much effort into each single episode as possible! I also see a lot of you commenting that you would like to see more videos each week. While I would love that too it just isn't possible for me at the current time. Making these videos takes A LOT of time and while I try to put all my focus into the CZcams channel I do have to dedicate myself to client work here and there in order to pay the bills. If you would like to see more videos I would suggest becoming a Patreon Supporter. This allows me to put more time into the channel without having to worry about the financial aspect. You can do so here: patreon.com/brackeys
    Thanks for being so awesome and supportive! Can't wait to bring you guys more content :D

    • @bigjay9184
      @bigjay9184 Před 7 lety +2

      Gr8 series...keep going buddy

    • @skorpion4368
      @skorpion4368 Před 7 lety +4

      Brackeys, Is there anyway to donate you by SMS ? You are doing great work, and I actually feel like, I can make games. BTW. sorry for bad grammar XD

    • @skorpion4368
      @skorpion4368 Před 7 lety

      Lol 666$ per week :_:

    • @varshitratna9688
      @varshitratna9688 Před 7 lety

      Brackeys i have published an app in play store after learning from your videos. Beat My Score. an endless game when troll faces irritate us while playing. it will be soon on appstore. please make a review video or a short video showing my app in ur videos

    • @GameDevelopmentChannel
      @GameDevelopmentChannel Před 7 lety

      Thanks

  • @mingangxu2125
    @mingangxu2125 Před 4 lety +1577

    Anyone else get that feeling of satisfaction when the code works

    • @autonaut279
      @autonaut279 Před 4 lety +23

      Totally

    • @counterscam6547
      @counterscam6547 Před 4 lety +180

      anyone feel the frustration after spending hours debuging and finding out a letter was lowercase

    • @pinkiepurplez
      @pinkiepurplez Před 4 lety +18

      Same, its like you are a pro gamer.

    • @rocketlad1454
      @rocketlad1454 Před 3 lety +42

      ​@@counterscam6547 that is the worst feeling in the world.

    • @sutirthjha4539
      @sutirthjha4539 Před 3 lety +6

      Yeah

  • @ninjaaa_lol5306
    @ninjaaa_lol5306 Před 7 lety +1909

    I would rather have 100 simple and short tutorials like this than any other way

    • @geluidsbox9195
      @geluidsbox9195 Před 6 lety +44

      Found this one after following a tutorial that took me over 8 hours, tutorials like this with 10 minutes per part are great!

    • @stefantanasa13
      @stefantanasa13 Před 5 lety +31

      You are absolutely right. It is best to learn in small steps and always with a practical example in front of you so that the information is 100% understood. Great tutorials!

    • @MaxCE
      @MaxCE Před 5 lety +5

      ikr

    • @thatoneweirdkidd
      @thatoneweirdkidd Před 5 lety +4

      Ikr

    • @DeTalented
      @DeTalented Před 4 lety +2

      666 likes... NICE

  • @morningawesome
    @morningawesome Před 11 měsíci +48

    6 years and this is still so freaking helpful. I'm grateful your channel exists

  • @TheKaswestcomix
    @TheKaswestcomix Před 4 lety +1344

    I'm seriously having the best time doing this.
    Every step is working as I go, and I'm building confidence as I go.
    Thank you so much.

    • @duckking5702
      @duckking5702 Před 4 lety +9

      Ikr.

    • @goblinman3010
      @goblinman3010 Před 4 lety +22

      Hell yeah let's keep at it

    • @lachiebell9656
      @lachiebell9656 Před 4 lety +3

      same

    • @martinvdev1565
      @martinvdev1565 Před 4 lety +21

      I am smiling every time I do any kind of little thing is just so...
      Just feels good

    • @averywow
      @averywow Před 4 lety +7

      sameee any time i've ever tried doing *anything* creative it ended up horribly but i feel like a pro when i do this lol

  • @calebc339
    @calebc339 Před 4 lety +412

    i watched this 3 times while my unity loaded

  • @patrik8642
    @patrik8642 Před rokem +48

    the camera code is
    using UnityEngine;
    public class FollowPlayer : MonoBehaviour
    {
    public Transform player;
    public Vector3 offset;
    // Update is called once per frame
    void Update()
    {
    transform.position = player.position + offset;
    }
    }
    for anyone who can't see the video at the moment
    edit: ah yes i figured it out, after dragging the script to the camera and selecting the camera, there should be a slot where you can drag the cube on, and like Jonathan said change the offset a little and you should be good to go.

    • @jonathanlindqvist570
      @jonathanlindqvist570 Před rokem +3

      Thanks. And also don't forget to adjust the "offset" values in Unity so that you can actually see the cube :) Otherwise you'll be inside of it. Just click the camera and put like x=0, y=2, z=10 or whatever you think works well.

    • @cancerina4474
      @cancerina4474 Před rokem

      @@jonathanlindqvist570 hey bro can you see the video?

    • @jonathanlindqvist570
      @jonathanlindqvist570 Před rokem

      @@cancerina4474 No I can't see it either unfortunately. But I fixed the camera that way, perhaps there are better ways :)
      Edit: just use the code provided above by Patrik Puskas, add a script to the camera and put the code there. Then go in to Unity and adjust the offset values when you have selected the camera. Hope it works!

    • @cancerina4474
      @cancerina4474 Před rokem

      @@jonathanlindqvist570 do you got a discord so i can ask you something because i got stuck?

    • @jonathanlindqvist570
      @jonathanlindqvist570 Před rokem

      @@cancerina4474 sure, give me your discord tag and I'll add you

  • @megatoast5984
    @megatoast5984 Před 2 lety +15

    4 years later, even after retirement, his tutorials are helping so many such as me. thanks, dude

    • @HazardIg
      @HazardIg Před rokem

      I'm upset because the video isn't working anymore.. it hasn't been deleted, it just doesn't work. I've refreshed the app, restarted my device, switched devices, nothing works...

    • @lunathecat4318
      @lunathecat4318 Před rokem

      @@HazardIg same, it doesn't work for me

    • @HazardIg
      @HazardIg Před rokem

      @@lunathecat4318 okay so it's definitely a youtube problem then.. well I guess we'll have to learn by ourselves lol

    • @swordeyeman2884
      @swordeyeman2884 Před 8 měsíci

      ​@@HazardIgmine is working

  • @mr.mysteriousyt6118
    @mr.mysteriousyt6118 Před 7 lety +446

    simple and clear I love what you're doing

  • @ashleywolf5522
    @ashleywolf5522 Před 5 lety +225

    UDEMY is like a psycho ex who just keeps coming back even though I’ve already reattached with Brackeys.

    • @NoOffenseAnimation
      @NoOffenseAnimation Před 5 lety +9

      I remember getting jealous I couldn't have Udemy but turns out, like, YT tutorials are mostly better...

    • @nothingtoseehere6142
      @nothingtoseehere6142 Před 5 lety +1

      @@NoOffenseAnimation The classes are like ten bucks a piece.

    • @shashwatpandey8766
      @shashwatpandey8766 Před 3 lety

      Ashley, that's awfully specific, you okay?

    • @fatmasayah109
      @fatmasayah109 Před 2 lety

      @@nothingtoseehere6142 10 bucks a breath u take in them lol

  • @rajdhakate617
    @rajdhakate617 Před 3 lety +41

    It's been 4 days I've discovered this channel and I'n already in love with game development. You make your videos very interesting and educational. Very well done.

    • @stealth2338
      @stealth2338 Před 2 lety

      and its been 5years for me and this video is really helpful.

  • @zerorilation
    @zerorilation Před 4 lety +753

    During Quarantine : I'm bored..
    Also During quarantine: Learning unity via tutorials
    Who else is here during the pandemic?

    • @ente-cover2246
      @ente-cover2246 Před 4 lety +7

      Haha me too, have fun coding ;)

    • @codeylee8494
      @codeylee8494 Před 4 lety +3

      i already knew python thanks to my CS class but i prefer making games which isn't as easy with python so these videos have really helped, i'm also doing this @ 02:15 so i'm not getting up in the morning lol.

    • @KraisonFrameworks
      @KraisonFrameworks Před 4 lety +2

      Me. I got inspired to make a game, so here we are.

    • @paulowg7940
      @paulowg7940 Před 4 lety +1

      me too

    • @sanderbos7941
      @sanderbos7941 Před 4 lety

      yup..

  • @krishbeats6957
    @krishbeats6957 Před 4 lety +8

    the most legendary and beginner-friendly game- dev tutorials I have ever seen on youtube
    thank you, bro
    i hope u succeed in ur youtube and game development life

  • @larry9195
    @larry9195 Před 3 lety +6

    the thing I love about these tutorials is that they are free. I was watching some other CZcamsrs on how to do this (no offense to them but they couldn't teach crap), then I come here, watch the first tutorial and... to say the least... I'm instantly hooked. these are *FREE*. I've never taken a paid online course but its gotta be on par with this AT LEAST if I'm ever gonna buy them.
    *This guy has the right idea about teaching beginners.*

  • @aliciabogdan1110
    @aliciabogdan1110 Před 5 lety

    About 2 months ago I decided I want to make at least one video game this summer. You motivated me to start right now, and I'm super happy that I can learn really easy with your tutorials. I just wanted to say THANK YOU for putting so much effort in these tutorials and helping others out, I really really appreciate it

  • @whyzen2081
    @whyzen2081 Před 3 lety +1

    I've been trying to learn the basics as a complete beginner, and I've started and stopped on different tutorials and courses probably 5 times in the last few months, as I usually find the instructions to be difficult to digest with no relatable experience. But watching your series is a breath of fresh air. I finally feel like I'm getting somewhere. I just wish I started learning when I was younger, as my 30 year old brain is like a sieve at this point.

  • @gcasello494
    @gcasello494 Před 4 lety +74

    Just in case someone like me gets lost:
    If you added the script and all, make sure you added the component to the Main Camera and not to the Player. Dumb me did that, and I spent 10 minutes trying to figure that out.

  • @autumn_exe8785
    @autumn_exe8785 Před 3 lety +4

    Thank you so much for these easy to understand tutorials. You’ve somehow made me excited to learn more code. You’re tutorials are the best!

  • @MijmerMopper
    @MijmerMopper Před 9 měsíci

    I love how you are actually teaching the basics people like me want to know. I can now apply the same basic information to play around and make the light a spotlight that follows the player.

  • @d-bro-sector36
    @d-bro-sector36 Před 3 lety

    Even though it goes fast, it is logical enough to follow, and your face and voice are super friendly which makes it a very pleasant learning experience.

  • @serg10x
    @serg10x Před 5 lety +3

    These tutorials are amazing, I took programming sometime ago so this is a nice refresher!

  • @willpetillo1189
    @willpetillo1189 Před 3 lety +64

    For those using this as a reference or wanting to review specific parts
    of the lesson, here are some time-stamps of interest:
    0:11: Setting the camera's parent.
    0:49: Writing a script to control camera movement
    1:25: Accessing the Transform of a different object
    2:55: Setting an object's position to match another object's position
    4:07: Adding an offset to the camera follow for a 3rd person view

  • @zooMbasta
    @zooMbasta Před 3 lety +2

    it's so unbelievably exciting to wonder about the different things you can actually do with these tools, and knowing so little about it makes it even better,
    letting your mind race and wonder what could be made.

  • @ScoutOW
    @ScoutOW Před 4 lety +2

    I just wanted to say you seem like a really great person and clearly, it shows, you always have a smile on your face like you are so excited to teach us and honestly it makes me so motivated to keep learning, so from the bottom of my heart, thank you so much for these videos!

  • @bojken5384
    @bojken5384 Před 7 lety +81

    Thanks Brackeys again.Keep doing what you're doing.You are the man bro.

  • @BaconPvP101
    @BaconPvP101 Před 7 lety +127

    Amazing, you explain everything so well. Thanks, can't wait for the next episode!

  • @ShaneeeXD
    @ShaneeeXD Před 11 měsíci

    I love how he seems always excited to teach and share somethings with us right from the start of the video. Thank you so much!!!

  • @tomgreenan9521
    @tomgreenan9521 Před 5 lety +1

    This is the best tutorial series I have ever watched on anything! Really well done

  • @miffedcrew8868
    @miffedcrew8868 Před 6 lety +45

    6:24 What we all think of CZcams!

  • @seunn
    @seunn Před 7 lety +23

    This series is seriously a BIG help, I am a 10 year old game designer, (I have been interested in making games more than playing them) and your tutorials are the best I could find on the internet. Would recommend to anyone starting in unity!

    • @Elektro8888
      @Elektro8888 Před 7 lety +8

      I envy you lol.Wish i had access to this when i was 10 :D

    • @Beyblade0battles
      @Beyblade0battles Před 6 lety +7

      I'm very happy to see you two young people trying to develop games! You are the future! Good luck my friends!

    • @user-pq4mt7em3i
      @user-pq4mt7em3i Před 6 lety +3

      Lol I am 12 and developing tooo xD

    • @brainiax2602
      @brainiax2602 Před 6 lety +9

      xblooified no way you’re ten, you have better grammar than like half of the internet.

    • @loogmm
      @loogmm Před 6 lety +1

      13 XD

  • @ypaut
    @ypaut Před 5 lety +1

    Even as a CS student, with my head hit all day with OO programming, your vids are nothing like boring. Best chanel.

  • @pajaspk
    @pajaspk Před 4 lety

    This guy has real ability to learn others ! The way he explains programming is so cool . I have met lots of teachers, who were not able to transfer the knowledge this effectively :) good work

  • @KineticPixell
    @KineticPixell Před 7 lety +10

    You have amazing tutorials!! I am currently busy on a game and your basic tutorials like this really help me with it!
    I am making a game at school and the teacher is really looking forward to my finished product :D

    • @Stormy566
      @Stormy566 Před 7 lety +1

      Post a link to some pictures of it when you are done :D and don't forget to reference Brackeys if you copied any code directly :)

    • @KineticPixell
      @KineticPixell Před 7 lety +1

      Shane McNeill Alright!!
      I will do that :D

    • @TheMegaLeotv
      @TheMegaLeotv Před 5 lety +1

      @@KineticPixell So what happened to a game?

  • @xDeLoreanMusicx
    @xDeLoreanMusicx Před 7 lety +3

    Continue your videos man, its very helpfull and you're a great teacher ! Nice work Brackeys :D

  • @sixdsix5028
    @sixdsix5028 Před 4 lety

    These are really solid tutorials, mate! I am almost 30 years old and trying to get into game dev again. I screwed around with GameMaker in my teens for a few months and haven't really done anything else since. Cheers!

  • @coltonsparks9079
    @coltonsparks9079 Před 4 lety

    I don't comment much, but I love this guy's videos. I've tried so many things to learn gaming making. I've done Udemy, Corsera, and a few others. All of them seem to throw you into the wolves den when you start and they give you too much info in a short amount of time, its refreshing to see someone who is taking us steps at a time. One thing I'm glad about is that I just found this channel a while ago, so i have a massive backlog to watch and learn. Thank you so much Brackeys.

  • @user-vz7um7om6k
    @user-vz7um7om6k Před 4 lety +52

    lol u still give hearts even after 2 years... thats so cool.... btw ur tutorial is way more easier to understand then others i watch :)

  • @deadoralive5690
    @deadoralive5690 Před 4 lety +3

    I donated to patreon, liked and subscribed! Keep up the hard work!

  • @lukeblaker5625
    @lukeblaker5625 Před 4 lety

    I was worried I'd have to end up coding something to make the camera follow the player, but I'm happy it was so simple. I'm so glad your channel exists, thanks!

  • @sajadtorkamani9399
    @sajadtorkamani9399 Před 4 lety +1

    Wow, these are some of the best tutorials I've ever seen on any topic!

  • @sebastiandeerhead4564
    @sebastiandeerhead4564 Před 7 lety +10

    So cool! Thanks, Brackeys!

  • @camikitty276
    @camikitty276 Před 4 lety +14

    i think this is the only time i've pressed the bell when the youtuber says too

  • @fuzzybrickstudios2315
    @fuzzybrickstudios2315 Před 3 lety

    it feels so much easier once you finish all of the trouble shooting and even that is fun! thanks so much for making these tutorials!

  • @one.framer
    @one.framer Před 3 lety +1

    Thank you for this series, its so easy to learn from you, I made the game in about 7 hours and remembered everything, Thank you so much!!!!!

  • @inlearn1009
    @inlearn1009 Před 3 lety +6

    6:24 *the first time Brackeys shows emotions.*

  • @osmanmohammad9118
    @osmanmohammad9118 Před 5 lety +7

    tHIS GUY DESERVES THE BEST THIS GUY DERSERVES WAY MORE SUBS.

  • @teamFlemiX94
    @teamFlemiX94 Před 5 lety +1

    I'm loving this series, the tutorial are so clear and quick, thanks a lot.

  • @jdgfshdjfkakahdkshfhdjdh

    I love these so much, trying a code and finding the problem when it doesn't work is so frustratingly satisfying

  • @ataba8481
    @ataba8481 Před 5 lety +190

    I did every single thing in the video in the same way that you did. BUT, it did not work the camera is still rotating with the player...help
    **(edit) nevermind I found the problem... I forgot to unparent the camera.**

    • @nachoe1266
      @nachoe1266 Před 5 lety +9

      jaaj i was looking for 30 min and saw your edited comment
      thnx

    • @mythicknight8269
      @mythicknight8269 Před 4 lety +4

      @@sbruins35 Drag it away from whatever you parented it to and place it I anywhere in the hierarchy (were all your other things are)

    • @mythicknight8269
      @mythicknight8269 Před 4 lety +5

      Edits isn't working so I'm gonna put this here 0:48 is were he Un-parents the camera

    • @bgsquiff5116
      @bgsquiff5116 Před 4 lety +1

      Thanks!

    • @DashMatin
      @DashMatin Před 4 lety +1

      directed by :

  • @TimM-kz1vl
    @TimM-kz1vl Před 4 lety +11

    My notes on this vid so you don't have to rewatch it: Video 4: Camera Follow
    Drag and drop camera onto player object. This creates a problem where the camera spins with the player and we must add a script to fix it. We then unparent the camera from the player (Drag camera object back to the list.) and create a script that makes the camera follow the location of the player.
    public Transform player; //adds a variable named “player” that tracks their Transform (Location)
    This will create a slot in the inspector for the camera. Just drag the player object to that slot.
    Then add transform.position = player.position // transform with a lowercase t refers to the location of our current object, aka the object this script is sitting on (the camera) then tells the camera’s position to update to the player’s position.
    At this time, the camera is now inside the player object and we want to move it back.
    We’re going to go back into the FollowPlayer script and add public Vector3 offset;
    Vector3 is just keeping track of the x y and z variables. Set the variables to w/e you want the camera offset to be like Y 1 and Z -5 to move the camera up and back.
    Then go back into the code and change
    transform.position = Player.position;
    to
    transform.position = Player.position + offset; //this means your camera’s position is the same as the player’s but combined with the offset.

    • @greyseth2721
      @greyseth2721 Před 4 lety

      it says that Transform does not contain a definition for potition :\

    • @TimM-kz1vl
      @TimM-kz1vl Před 4 lety

      @@greyseth2721 try lowercase transform

    • @1nsstinct227
      @1nsstinct227 Před 3 lety

      thank you it helped a lot

  • @Diegovnia
    @Diegovnia Před 3 lety +1

    These are great! I was learning Python for a while now as I was really scared of C# and here I am actually seeing that C# isn't that hard, plus the satisfaction that the code have real life output. Thanks!

  • @vaaronka
    @vaaronka Před 4 lety

    You are the first youtuber what i saw who cuts the crap, has a good tempo and says only the important information. Keep up!

  • @GavinHaubeltMedia
    @GavinHaubeltMedia Před 7 lety +5

    Awesome as always!

  • @AdiHasArrived
    @AdiHasArrived Před 6 lety +5

    I'd reccommend anyone starting with game development to watch Brackey's tutorials.

  • @perlinfall
    @perlinfall Před 4 lety

    Your tutorials are some of the best I've ever seen. Worth more then PAYED tutorials.

  • @woslogoslo4932
    @woslogoslo4932 Před 3 lety +2

    I am starting programming while still in highschool so that i have experience when looking for a job. This series is really helping me thanks so much!

    • @srimannsatpathy761
      @srimannsatpathy761 Před 3 lety

      I am still in middle school and i am starting to learn programming in c# and python not to brag but yeah

  • @gs4207
    @gs4207 Před 5 lety +12

    how to make the camera moves with the player .
    hold the camera and drop it on the player . DONE !
    30 second tutorial .
    THIS IS WHY I LOVE THIS CHANNEL . . . because of its SIMPLICITY
    P.S . I watched the whole video

  • @BradyHege
    @BradyHege Před 4 lety +5

    For anyone that got a compiler error saying that transform (in the line transform.potition = player.position) this is what worked for me:
    Create a new public transform (I called it "me") and set that transform object to the camera. Then just change (transform.position = player.position) to (me.position = player.position)

  • @Chevifier
    @Chevifier Před 5 lety

    Clear, concise to the point. What more could I ask for. Loving these.

  • @forevermovies655
    @forevermovies655 Před 7 měsíci

    You are the best unity tutor in the universe! NGL!

  • @owez7113
    @owez7113 Před 5 lety +13

    To make an automatic offset:
    top of class:
    *private Vector3 offset*
    start method:
    *offset = transform.position - player.position;*
    update method:
    *transform.position = player.position + offset;*

    • @TheHollowayPower
      @TheHollowayPower Před 4 lety +2

      Owez wait what lol

    • @TheHollowayPower
      @TheHollowayPower Před 4 lety

      @Achintya Dass shut up

    • @kasiaczek0000
      @kasiaczek0000 Před 4 lety

      thanks! helped

    • @kasiaczek0000
      @kasiaczek0000 Před 4 lety +2

      ps. that is my code
      using UnityEngine;
      public class camerafollow : MonoBehaviour
      {
      public Transform player;
      public Vector3 offset;
      void Start ()
      {
      offset = transform.position - player.position;
      }
      void Update ()
      {
      transform.position = player.position + offset;
      }
      }

    • @bedirhansiniko6757
      @bedirhansiniko6757 Před 4 lety

      @@kasiaczek0000 Thanks. I was having an error and your code worked!

  • @LiterallyWize
    @LiterallyWize Před 3 lety +16

    "Unless you have experience with college level math,"
    Me, a person that used to have experience with math and now doesn't; *_casually starts shaking_*

  • @chadxox3
    @chadxox3 Před 3 lety

    If anyone has the issue in the console where it says something about SystemDebug or UnityEngine.Debug, then change...
    "Debug.Log(player.position);"
    To
    "UnityEngineDebug.Log(player.position);"
    PS: You just earned a sub because of this. So many people have made this a lot more complicated then it should be when it comes to using Unity or coding, you are not one of those people. Thanks Brackeys.

  • @lukalevak1434
    @lukalevak1434 Před 4 lety +1

    Seriously, good job! This makes learning unity so much easier!

  • @queengold3801
    @queengold3801 Před 2 lety +3

    I am still in High School, and this really helped me, so i think when we start to do things like this, I will be able to be really good at it. Thanks :)

    • @HazardIg
      @HazardIg Před rokem

      Bro cam you maybe help me out? The video won't load as if it's been deleted.. I really wanna be able to know how to make the camera work but I can't without this video

    • @GioTeo
      @GioTeo Před rokem

      @@HazardIg same happens to me, did you find a fix?

    • @GioTeo
      @GioTeo Před rokem

      Actually, someone else in the comments posted a different video which is for the camera as well: czcams.com/video/MFQhpwc6cKE/video.html

    • @HazardIg
      @HazardIg Před rokem

      @@GioTeo Not yet no, still trying things out

    • @HazardIg
      @HazardIg Před rokem

      @@GioTeo found a work around

  • @kryptictoast229
    @kryptictoast229 Před 4 lety +264

    yeah i call myself a coder
    c copy
    o off
    d brackeys
    e tutorials
    r :)

  • @thenightowl2012
    @thenightowl2012 Před 5 lety +1

    This Series is so good im making my first right now and this is helping me understand how to use Unity! Thanks!

  • @denysbaiev167
    @denysbaiev167 Před 2 lety +1

    You are a great team! I started from your C# tutorials and now I'm studying Unity by your videos. And this is very fun and inspiring! Thank you!

    • @Pezicodes
      @Pezicodes Před 2 lety +1

      Hi.
      I learnt all i know from brackeys...
      I'm a game developer too........
      I can help with any question
      please ask your questions i can help
      i also make game development videos
      please support my channel
      czcams.com/users/itsPeziTutorials

  • @scripticstudios2022
    @scripticstudios2022 Před 3 lety +6

    This doesn't work for me... I followed along with the tutorial and even downloaded the source code and nothing changes; it doesn't even give a first-person view. I really enjoyed your tutorial and hope I can get some help.
    EDIT: I used Brackeys Smooth Camera Tutorial and I got it to work.

  • @hollowsoul5499
    @hollowsoul5499 Před 4 lety +14

    worked for me in visual studio 2019 & unity 2020 like this
    using UnityEngine;
    public class followPlayer : MonoBehaviour
    {
    public Transform playerTransform;
    private Vector3 _cameraOffset;
    [Range(0.01f, 1.0f)]
    public float SmoothFactor = 1f;
    void Start()
    {
    _cameraOffset = transform.position - playerTransform.position;
    }
    void LateUpdate()
    {
    Vector3 newPos = playerTransform.position + _cameraOffset;
    transform.position = Vector3.Slerp(transform.position, newPos, SmoothFactor);
    }
    }

  • @voxelbugged
    @voxelbugged Před 4 lety +1

    Thank you for these tutorials, I wanted to get into using Unity once but it was very confusing, but now I understand things.

  • @adorablehoe
    @adorablehoe Před 3 lety +2

    Dude, your tutorials are freaking awesome! For once a tutorial video that's very info-dense and it's easy to follow!

  • @christianjones3516
    @christianjones3516 Před rokem +4

    This video isn’t working for some reason, but he has another video of the camera follow
    Just search “smooth camera following in unity” and it should show up

  • @knezivan1
    @knezivan1 Před 5 lety +25

    offset = transform.position - player.transform.position;
    that way it stays the way you made it in the scene editor

    • @swayam2316
      @swayam2316 Před 5 lety +2

      Thx bro my player would go flying like crazy if you didnt give me that code

    • @bedtimepodcast8798
      @bedtimepodcast8798 Před 4 lety +1

      thank god your here. i wouldnt of been able to do the code without you lol!!! thx :D

  • @matex329
    @matex329 Před 8 měsíci

    this is the next day ( or night again) of making this game
    1 problem that I had is when I tried to run the script of the camera following the player it started going backwards fast after some thinking I realised that I've accidentally got player follow on the camera and player. Turned it off on player and it worked!
    thanks for making me actually want to create games

  • @antonyynotna202
    @antonyynotna202 Před 4 lety +1

    I don't usually Like and click on notifications, but when I do, it means this person is awesome! Im new to coding so this is just amazing.

  • @chickenscripkids9465
    @chickenscripkids9465 Před 3 lety +5

    every time he says, "to do that we need to add another variable" i feel like im dying inside

  • @ajaydubey304
    @ajaydubey304 Před 5 lety +7

    To the people having problem with follow player script... drag and drop follow script to main camera and set offset accordingly.

  • @cerulity32k
    @cerulity32k Před 3 lety

    Every time I write code, it works, and I understand and learn stuff, I get exponential satisfaction. Now I can move a player with controls and have the camera follow!

  • @dhunHERO
    @dhunHERO Před 3 lety

    THIS IS MY JAM, C# AND UNITY TUTORIAL ALL IN ONE IN A WAY I ACTUALLY UNDERSTAND, THANK YOU KIND SOUL

  • @HemantR.20930
    @HemantR.20930 Před rokem +7

    If ur watching in 2022, does anyone have problem watching the vid it keeps saying An error occurred. Please try again later for me..

    • @fodogamer6654
      @fodogamer6654 Před rokem

      i reupload this on my channel
      czcams.com/video/-r7o4UcSKSE/video.html
      you can check it out and continue!

  • @KF67382
    @KF67382 Před rokem +3

    @Brackeys why does it say something went wrong tap to retry anyone else have this issue

  • @vincentsavoretti2201
    @vincentsavoretti2201 Před 3 lety

    You're a gift, pure and simple

  • @geedogx8143
    @geedogx8143 Před 5 lety

    Loving this im away to learn game development at college and this so far is giving me a big headstart

  • @samuelshim4263
    @samuelshim4263 Před 4 lety +6

    Hi dude, amazing video. I'm following it as I'm writing this. One question I had is that my Visual Studio doesn't seem to have the autocomplete that you have. Specifically for the components used by UnityEngine. I'm not sure how to get it. I looked online and they said restarting both VS and Unity should help, but this did not solve it. Is there something else I need to get? Like a plugin or something? Thanks

    • @linaloulou834
      @linaloulou834 Před 4 lety +1

      You have to download Unity tools via Visual Studio installer. Go to Modify/Individual Components in Visual Studio installer, find Unity tools, tick the box, and complete the download.

    • @boredificationable
      @boredificationable Před 3 lety

      I had the same problem. JustTestOnly Haha got it right. You have to install unity tools via Visuall Studio Installer. docs.microsoft.com/en-us/visualstudio/cross-platform/getting-started-with-visual-studio-tools-for-unity?view=vs-2019 is what helped out

    • @tushardey7179
      @tushardey7179 Před 3 lety

      Go to Edit>Preferences>External Tools. Choose Visual Studio in the External Script Editor. It should be working fine now

  • @cianmeegan1215
    @cianmeegan1215 Před 6 lety +5

    Brackey i followed your player movement script but it keeps saying the parameter name player and offset are duplicates, ive even downloaded your project files and used that one but the problem keeps happening, can you help me?

  • @AngelRodriguez-hs7bc
    @AngelRodriguez-hs7bc Před 4 lety +1

    This is very helpful! I appreciate the details you put out in the video, it was very informative!

  • @MickRayzee
    @MickRayzee Před 7 měsíci

    wish i found this earlier... so far this is the best explained bite sized chunks, just enough to digest :) Awesome vids

  • @natemixon6346
    @natemixon6346 Před 4 lety +3

    Im having trouble getting the camera angle to shownlike his does in the game view. Any suggestions?
    Edit: So I fixed it I went to main camera and open/added another camera and that fixed it

  • @LUMINA3
    @LUMINA3 Před 4 lety +37

    When I saw the title, I wanted to try to do it before watching...
    *A N D I T W O R K E D*
    wait actually nvm i was doing the game object way ;-;

  • @codeoftheprogrammer7171

    I'm loving this series.

  • @kiwigabroos9743
    @kiwigabroos9743 Před 3 lety

    GOT A UNI PROJECT, AND THIS IS THE BEST WAY TO LEARN UNITY YOU ARE A LEGEND BRO 1000X TIMES BETTER THAN MY LECTURERS

  • @scottfrost6181
    @scottfrost6181 Před rokem +3

    Video 4 is not working. comes up with a video error message

    • @fodogamer6654
      @fodogamer6654 Před rokem

      i reupload this on my channel
      czcams.com/video/-r7o4UcSKSE/video.html
      you can check it out and continue!

  • @thatkiddanny
    @thatkiddanny Před rokem +5

    Anyone else not able to watch the video due to a playback error? I can watch every video except this one just fine

  • @Kanelle88
    @Kanelle88 Před 2 lety

    I remember a game that did parenting with the view. It was a racing game on an Amiga 500. We hooked up four of them and were doing an ancient race game similar to Mario cart. The crazy camera view was a highlight of it actually. It made for some crazy and entertaining crashes.

  • @PieManDan777
    @PieManDan777 Před rokem

    Just Starting Game Development With Unity.
    Thanks For The Help

  • @nathanyao3525
    @nathanyao3525 Před rokem +5

    June 2022, is this video not loading for anyone else?

    • @fodogamer6654
      @fodogamer6654 Před rokem

      i reupload this on my channel
      czcams.com/video/-r7o4UcSKSE/video.html
      you can check it out and continue!

  • @slayer5171
    @slayer5171 Před 4 lety +4

    If anyone get error NullReferenceException: Object reference not set to an instance of an object. I try to put this :
    player = GameObject.Find("Player").transform;
    inside start() function, just change Player with your player name. Now it's works well.

    • @lubie_gielde5076
      @lubie_gielde5076 Před 4 lety +1

      Why is it happening

    • @mustafa460
      @mustafa460 Před 4 lety

      @@lubie_gielde5076 Because you didn't drag your object that you wanted the camera to follow in the script you just made in unity..
      what it means is that the program still didn't know what object to follow..
      If you save the script and go to unity and click on the camera.. you will see the script and inside it you will see the name player that you just made public is without any object to follow..
      so either drag the player from the samplescenes to the cameras script.
      or do as Denny said.
      and the camera will start following just fine.

  • @FoolOnDead
    @FoolOnDead Před 3 lety

    thank you so much for these tutorials. you make it easy to understand

  • @riccardo3647
    @riccardo3647 Před 4 lety +1

    No comment… seriously, I have been watching your tutorials and I AM FINALLY UNDERSTANDING something! Thank you so much bro :D