First Person Movement Unity 2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024

ความคิดเห็น • 260

  • @BloxyDev
    @BloxyDev  2 ปีที่แล้ว +18

    comment below what you though of the video and what I can improve on and don't be afraid to give me suggestions for future videos!

    • @kushals.p1267
      @kushals.p1267 ปีที่แล้ว +1

      Can i use version 2020.3.24f1

    • @BasicCheats
      @BasicCheats ปีที่แล้ว +1

      i loved the video so much thx bro this is working way to good

    • @LoFiMonk
      @LoFiMonk ปีที่แล้ว +1

      It's a great video. I'd like to see a tutorial like this with the new input system

    • @Redditstories1874
      @Redditstories1874 ปีที่แล้ว +2

      Pls make a video on creating an enemy AI I cant really figure it out!

    • @Redditstories1874
      @Redditstories1874 ปีที่แล้ว +2

      btw this was the most detailed video Ive seen for my new project- thanks :)

  • @LuckyEcho
    @LuckyEcho 8 หลายเดือนก่อน +23

    Why is it always the small youtubers who make better content than the big ones? Good job, this helped a lot.

  • @Wreckk_
    @Wreckk_ ปีที่แล้ว +33

    FOR THE PEOPLE WHOS JUMP FUNCTION WONT WORK, YOU SELECT BOTH THE NEW GROUND LAYER YOU MADE AND THE DEFAULT LAYER AS WELL, good luck on your game.

  • @WoodrowsAmazingWorld
    @WoodrowsAmazingWorld 8 วันที่ผ่านมา +2

    I think this is the best tutorial I’ve found so far on player controls

  • @RB_UkiaVZ
    @RB_UkiaVZ 6 หลายเดือนก่อน +2

    It didnt work for me so i fixed it
    >>
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class Movement : MonoBehaviour
    {
    [SerializeField] Transform playerCamera;
    [SerializeField][Range(0.0f, 0.5f)] float mouseSmoothTime = 0.03f;
    [SerializeField] bool cursorLock = true;
    [SerializeField] float mouseSensitivity = 3.5f;
    [SerializeField] float Speed = 6.0f;
    [SerializeField][Range(0.0f, 0.5f)] float moveSmoothTime = 0.3f;
    [SerializeField] float gravity = -30f;
    [SerializeField] Transform groundCheck;
    [SerializeField] LayerMask ground;

    public float jumpHeight = 6f;
    float velocityY;
    bool isGrounded;

    float cameraCap;
    Vector2 currentMouseDelta;
    Vector2 currentMouseDeltaVelocity;

    CharacterController controller;
    Vector2 currentDir;
    Vector2 currentDirVelocity;
    Vector3 velocity;

    void Start()
    {
    controller = GetComponent();

    if (cursorLock)
    {
    Cursor.lockState = CursorLockMode.Locked;
    Cursor.visible = true;
    }
    }

    void Update()
    {
    UpdateMouse();
    UpdateMove();
    }

    void UpdateMouse()
    {
    Vector2 targetMouseDelta = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));

    currentMouseDelta = Vector2.SmoothDamp(currentMouseDelta, targetMouseDelta, ref currentMouseDeltaVelocity, mouseSmoothTime);

    cameraCap -= currentMouseDelta.y * mouseSensitivity;

    cameraCap = Mathf.Clamp(cameraCap, -90.0f, 90.0f);

    playerCamera.localEulerAngles = Vector3.right * cameraCap;

    transform.Rotate(Vector3.up * currentMouseDelta.x * mouseSensitivity);
    }

    void UpdateMove()
    {
    isGrounded = Physics.CheckSphere(groundCheck.position, 0.2f, ground);

    Vector2 targetDir = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
    targetDir.Normalize();

    currentDir = Vector2.SmoothDamp(currentDir, targetDir, ref currentDirVelocity, moveSmoothTime);

    velocityY += gravity * 2f * Time.deltaTime;

    Vector3 velocity = (transform.forward * currentDir.y + transform.right * currentDir.x) * Speed + Vector3.up * velocityY;

    controller.Move(velocity * Time.deltaTime);

    if (isGrounded && Input.GetButtonDown("Jump"))
    {
    velocityY = Mathf.Sqrt(jumpHeight * -2f * gravity);
    }

    if(!isGrounded && controller.velocity.y < -1f)
    {
    velocityY = -8f;
    }
    }
    }

  • @OfficialKaiVerse
    @OfficialKaiVerse 10 หลายเดือนก่อน +3

    I have encountered a Glitch I can jump whilst in air causing to fly as long as you keep clicking Space if you keep clicking it then you stop for even a second you will have to wait till you touch the floor again.

    • @beau_mom3079
      @beau_mom3079 2 หลายเดือนก่อน

      any idea how to fix?

  • @fwoopie9128
    @fwoopie9128 2 หลายเดือนก่อน +1

    this is amazing. however i noticed movement is a bit buggy while on slopes, specifically the gravity, when i fall from a slope it just slams me into the ground immediately

  • @Arrzee.
    @Arrzee. ปีที่แล้ว +15

    *FOR THE PEOPLE WHOS JUMP PORTION DOESNT WORK READ THIS MESSAGE*
    Inside the Player, go into "Movement", on the Ground you select the "ground" layer and the "Default" layer
    I hope this helps

    • @Mistyre
      @Mistyre ปีที่แล้ว +2

      YOOOO MAN THX SOO MUCH

    • @MZentertainment206
      @MZentertainment206 ปีที่แล้ว +1

      ty sooo mutch broo i was legit getting concernd

    • @Chrono-Science
      @Chrono-Science ปีที่แล้ว

      You're the best

    • @Arrzee.
      @Arrzee. ปีที่แล้ว +1

      @@Chrono-Science I know 😎

    • @jimpix1008
      @jimpix1008 ปีที่แล้ว

      Thank you so much!!!!!

  • @IllyaMorgun
    @IllyaMorgun ปีที่แล้ว +9

    Here are a couple fixes for the jumping and other issues:
    1. Line 73 ; since the product of gravity (negative), and 2 (positive) is a positive integer we must subtract it from velocityY.
    My personal fix was : " velocityY -= gravity * -2.0f * Time.deltaTime "
    2. velocity (Vector3) and velocityY are basically the same so you could change velocityY to velocity.y; and the rest of the script respectively.

    • @Mistyre
      @Mistyre ปีที่แล้ว +1

      @@MonstrumReborn Inside the Player, go into "Movement (script)", on the Ground section you select the "ground" layer and the "Default" layer

    • @akirayo4168
      @akirayo4168 ปีที่แล้ว

      How about [serializeField] issue? Can you help me?

    • @TheMultiversalDip
      @TheMultiversalDip ปีที่แล้ว

      Holy smokes thats better, mine before was snapping when I fell of something. The only problem I'm getting is now I'm floating a lil' bit but I think I know how to fix that

    • @Al-tt6tj
      @Al-tt6tj 9 หลายเดือนก่อน

      also change isGrounded! to !isGrounded. to fix jumping on slopes

  • @Aovri
    @Aovri 8 หลายเดือนก่อน +1

    Bloxy Dev could I have some help I am trying to modify your code for a controller It already works with moving but I want to be able to look with right joy stick and jump with the east button also could it be modified to crouch with left joystick click down please help if you can Aovri

  • @alifsandi8152
    @alifsandi8152 8 หลายเดือนก่อน +1

    i have problem with the jump. if you press the jump button many times it will jumping for eternity. di someone know how to fix this?

  • @AlexFallingDown
    @AlexFallingDown 4 หลายเดือนก่อน +3

    Ive been trying to do this for HOURS looking at way to complicated "beginner" tutorials. This is an amazing tutorial and i will be recommending it to all of my coding friends. W

  • @ecayeta
    @ecayeta ปีที่แล้ว +4

    For all of those who don't know, you're not supposed to select both Default and Ground in the Player script, you're supposed to designate the objects on the map that are the floor and assign them to the Ground layer.

  • @BMCJuicyG
    @BMCJuicyG 9 หลายเดือนก่อน +2

    One last chicken very crispy

  • @FactuallyWOW
    @FactuallyWOW ปีที่แล้ว +1

    bruh mine doesnt jump and slides a bit when he stops walkingn hoiw do i stop this?!

  • @demizx
    @demizx ปีที่แล้ว +4

    bro is underrated , nice video

  • @flamingpower
    @flamingpower หลายเดือนก่อน +1

    Thanks boss! 🦍

  • @marcoraimondo5420
    @marcoraimondo5420 4 หลายเดือนก่อน +1

    whos this absolute cutieeeee

  • @tedivbg3354
    @tedivbg3354 ปีที่แล้ว +1

    thx man im ten but i know unity

  • @AndrewGrimm-w5d
    @AndrewGrimm-w5d ปีที่แล้ว +1

    what button is jump for some reason space is not working for me

  • @PACKY22
    @PACKY22 ปีที่แล้ว +1

    when i press play than it just says all complier errors have to be fixed. what do i do to fix that?

  • @beefytime1374
    @beefytime1374 ปีที่แล้ว +2

    Only one thats worked for me in like 5 tries, LOVE YOU SOOO MUUUUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! THANKYOUUUU

  • @bskt__
    @bskt__ ปีที่แล้ว +2

    bro you video is PERFECT! i'm begginer and i been working on it for 4h with alot of bugs etc. searching through alot of tutorial but none worked, and i found your video, YOU SAVED MY LIFE MAN, keep it up!!!

  • @coolgamermc2171
    @coolgamermc2171 ปีที่แล้ว +1

    when i drag the movement script, the movement script wont show up

  • @spaghettibaggetti6350
    @spaghettibaggetti6350 ปีที่แล้ว +2

    ok, great video but the jumping does not work for me and i was just wondering if you might have a fix for this?
    edit: i fixed it 👍👍

    • @briosh.mp4
      @briosh.mp4 ปีที่แล้ว

      another person say that : " Inside the Player, go into "Movement", on the Ground you select the "ground" layer and the "Default" layer "

  • @kudenokkaelain6026
    @kudenokkaelain6026 5 หลายเดือนก่อน +1

    First actually GOOD tutorial I found. Amazing work.

  • @crwdex
    @crwdex ปีที่แล้ว

    Do never do it again (Additional Layer for just Jump function) This is COMPLETELY wrong method

  • @zipey2453
    @zipey2453 4 วันที่ผ่านมา

    i keep falling on the terrain when i play can someone help

  • @BloxyDev
    @BloxyDev  2 ปีที่แล้ว +3

    Hope you enjoyed!

  • @Demagogines
    @Demagogines 2 หลายเดือนก่อน

    Hey, just started with Unity and your video helpedme out alot so far :D
    I have one problem thou. For some reason I can only look up and down, but cant move the camera left or right, even thou I followed your setup to a t.
    Any Idea how I might be able to fix this ?

  • @aaravponnapalli3007
    @aaravponnapalli3007 22 วันที่ผ่านมา

    im in a game jame i wasted a day on a bad idea i had to get something working and thos saved me you and amazing :)

  • @briosh.mp4
    @briosh.mp4 ปีที่แล้ว +1

    TYSM for your help :) and I do a platform game but when I fall without jumping, my character falls very quickly to the ground but if I fall while jumping, it falls normally

  • @Fr8552.
    @Fr8552. 3 หลายเดือนก่อน

    I cant jump ive watched a few other videos and it says you have to have a ridged body componet to the capsule but once i do that it just starts spinning like crazy i need help

  • @shingAMarie
    @shingAMarie 8 หลายเดือนก่อน

    ughh I just wasted three minutes of my life thinking I would learn some thing, but all it is is you showing what you did really quickly without any tutoring value. You’re smart I’ll give you that, but your method of teaching is lacking.

  • @DIBRA07-F
    @DIBRA07-F 7 หลายเดือนก่อน

    Broo when I put the script in to my capsule the script doesn't do anything man it's just a name o f the script that's all I cant do anything with this I can't move pls someone help❤❤

  • @jobraking
    @jobraking ปีที่แล้ว

    man pls help jump doesnt work

  • @AhmedSw-p6y
    @AhmedSw-p6y ปีที่แล้ว +1

    best movment script video ever

  • @pappermcflapper5329
    @pappermcflapper5329 ปีที่แล้ว +1

    could you do a video on how to add guns and reloading i'm making a game and it would help a bunch

  • @nootnot4548
    @nootnot4548 6 หลายเดือนก่อน

    help noob here . I already removed the errors but it seems there is no collision in my ground I always fall whenver I run

  • @ooo20059
    @ooo20059 7 หลายเดือนก่อน

    it sadly did not worked :(

  • @Fajnosis120
    @Fajnosis120 หลายเดือนก่อน

    It does a several hurts to my game. Thanks :)

  • @rekkimaru7
    @rekkimaru7 ปีที่แล้ว +8

    Been stumbling through a lot of character controller tutorials. There was always something off (like being catapulted into space when jumping on ramps and edges).
    Can't wait to try this one out! Keep up the good work!

    • @BloxyDev
      @BloxyDev  ปีที่แล้ว +2

      Well I'm glad I could help!

  • @slimers622
    @slimers622 8 หลายเดือนก่อน

    i ran into some issues so like when i move my mouse to turn it just turns everywhere and also the movement only lets me go in the sides

  • @thomasleonard9009
    @thomasleonard9009 ปีที่แล้ว +3

    Worked amazingly well for the most part, I just cannot jump. It would be very helpful if you could explain why or if the is a specific key. Thanks! Great tutorial :)

    • @BloxyDev
      @BloxyDev  ปีที่แล้ว

      Did you remember to set a ground layer?

    • @xotixvr3705
      @xotixvr3705 ปีที่แล้ว

      @@BloxyDev i did still dosent work

    • @messyvr1875
      @messyvr1875 ปีที่แล้ว +1

      @@xotixvr3705 i just figured it out and you need your ground to be set to default and the new layer you add( ground) hope this helped

    • @xlenzyl7604
      @xlenzyl7604 ปีที่แล้ว

      @@messyvr1875 im confused can you explain better what do you mean your ground to be set to default and the new layer you add( ground) i didn't understand i would be lots of help you could explain

    • @canadiandonuts12
      @canadiandonuts12 ปีที่แล้ว

      Nothing happened

  • @droiddomainofficial
    @droiddomainofficial 2 หลายเดือนก่อน

    Nothing worked, I did what u said and it didnt work.

  • @AGII-o6q
    @AGII-o6q 3 หลายเดือนก่อน

    How can i add a running to this script can anyone help pls

  • @danielleboston1066
    @danielleboston1066 ปีที่แล้ว +1

    hello im new to making games so i watched video and goin to be honested coppyed code and for me it not showin all the mouse sens and other stuff is it what i do is it cause code or do i need to save and exit it lol i dont know

  • @_Pollard_
    @_Pollard_ ปีที่แล้ว

    ty so much for this. because im making a backrooms game

  • @jaylindowney9757
    @jaylindowney9757 4 หลายเดือนก่อน

    bro you are the best you are the only one that works

  • @Bro-tl8jo
    @Bro-tl8jo ปีที่แล้ว +1

    Hey, i have a problem, when I run the game, it makes me fall into the void, can someone please help me, thanks

    • @TankAirsoft13
      @TankAirsoft13 9 หลายเดือนก่อน

      Make a platform to stand on

  • @good_noodlewastaken
    @good_noodlewastaken ปีที่แล้ว +1

    my jump doesnt work for some reason

  • @Inky_puppets
    @Inky_puppets 7 หลายเดือนก่อน

    can you make a tutorial for a wall jump

  • @slowness6818
    @slowness6818 ปีที่แล้ว +1

    Hello can sombady help me. You have open script menu where did you doing jump height ando more. And I cant open it can sombady help please.

    • @BloxyDev
      @BloxyDev  ปีที่แล้ว +1

      You need to put the script in the player for it to work.

  • @JUST_ME61501
    @JUST_ME61501 ปีที่แล้ว

    AMOGUSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

  • @MrDarthVR
    @MrDarthVR หลายเดือนก่อน

    dude idk how to write code

  • @Insertmorecoins1
    @Insertmorecoins1 4 หลายเดือนก่อน

    Great great video, my dude

  • @ElixirGolemUser
    @ElixirGolemUser 3 หลายเดือนก่อน

    How do i make it faster?

  • @mateothemlggamer7090
    @mateothemlggamer7090 ปีที่แล้ว

    there no 2023 movement script

  • @adude200
    @adude200 ปีที่แล้ว

    hippity hoppity your code is now my property

  • @PixRaggamer
    @PixRaggamer 5 หลายเดือนก่อน

    wheres the ground check?

  • @ParpleYt
    @ParpleYt 9 หลายเดือนก่อน

    What are the movement controls

  • @amerhammam1041
    @amerhammam1041 ปีที่แล้ว +1

    Running and sliding please

  • @MaxTheDev-f6t
    @MaxTheDev-f6t 2 หลายเดือนก่อน

    why do i fly up?

  • @megatreeboi
    @megatreeboi ปีที่แล้ว

    YOU CANT JUMPPPPPPPPPPPPPPPP

  • @DarknessIsaGoober
    @DarknessIsaGoober ปีที่แล้ว

    I found a a problems with the code. First, you can jump more than once through the air.

    • @BloxyDev
      @BloxyDev  ปีที่แล้ว

      not if you implemented the ground check correctly, I suggest you re-watch part of the video to see the ground check

  • @Rix4h.
    @Rix4h. 8 หลายเดือนก่อน

    how to make sprint

  • @josiahvee
    @josiahvee หลายเดือนก่อน

    it did not work

  • @Pablo957
    @Pablo957 23 วันที่ผ่านมา

    THX A LOT

  • @Firefox-hw3co
    @Firefox-hw3co ปีที่แล้ว +1

    Thank you soooo much!!! This helped a lot. Unity's FPS setup had my character rotation side to side all shakey. Ur tutorial sorted it out one time!!!

  • @gamingwithvihu8888
    @gamingwithvihu8888 ปีที่แล้ว

    This doesn’t work

  • @OfficialTjayYT
    @OfficialTjayYT 8 หลายเดือนก่อน

    My camera doesnt connect to the player. anyone know why? copied exactly what he did

    • @priskon5950
      @priskon5950 6 หลายเดือนก่อน

      you might have another main camera in your hierarchy

  • @argonaut_._152
    @argonaut_._152 3 หลายเดือนก่อน

    how do i jump

  • @Autumn4-4
    @Autumn4-4 6 หลายเดือนก่อน

    bro link code die

  • @svrge3092
    @svrge3092 ปีที่แล้ว

    BEAN, i miss danny

  • @BLACKDREAMIO
    @BLACKDREAMIO ปีที่แล้ว

    YOIUR MASTERPICE

  • @madelinemyhre2828
    @madelinemyhre2828 หลายเดือนก่อน

    I'm brand new and I'm setting up my first game for my dissertation, and you were such a lifesaver. Thanks for all the amazing work you do!

  • @thefroogguy
    @thefroogguy ปีที่แล้ว

    so i noticed that i can only jump if i go next to a cube why is that it and not the ground
    @anyone

    • @Bigblackhawk123
      @Bigblackhawk123 4 หลายเดือนก่อน

      The jump mechanic is horribly flawed in this code it seems

  • @Lucky_VR2
    @Lucky_VR2 ปีที่แล้ว

    I cant read that 😢

  • @Void-t8n
    @Void-t8n 9 หลายเดือนก่อน

    I think this idea would work great, if the variables would run. "The variable playerCamera of Movement has not been assigned.

  • @Dany21215
    @Dany21215 2 หลายเดือนก่อน

    i was searching videos of a lot of people for days and any video help me, but this video, help me a lot and finally i can make the first person camera, thank you a lot

  • @Foxy_box
    @Foxy_box 5 หลายเดือนก่อน

    39 Errors💀😭

  • @game_time2Official
    @game_time2Official 6 หลายเดือนก่อน

    dude I havent even opened Unity yet and its finally the same version LETS GO!!!!!!!!!!!!!!!

  • @StupidJellyfish
    @StupidJellyfish 7 หลายเดือนก่อน

    When I put this in, the camera turns completely to the right when I press play. I cannot figure out why.

  • @Inky_puppets
    @Inky_puppets 7 หลายเดือนก่อน

    i cant jump

  • @skebleton
    @skebleton 10 หลายเดือนก่อน

    I can only turn my camera on a x-axis/horizontal direction, any fixes?

  • @swe_robbe3006
    @swe_robbe3006 5 หลายเดือนก่อน

    The player falls through the ground what should I do

    • @Bigblackhawk123
      @Bigblackhawk123 4 หลายเดือนก่อน

      Add a rigidbody to the player

  • @baz_7
    @baz_7 5 หลายเดือนก่อน

    Thanks ❤

  • @onur8732
    @onur8732 ปีที่แล้ว

    mine is falling trough map or foalting in space what do i do

    • @Polestelar
      @Polestelar ปีที่แล้ว

      Have you put any collisions in your plane/ map?

  • @low_entertainment6632
    @low_entertainment6632 ปีที่แล้ว +1

    i Want to add sprint to the scripts can you help me pllzzzzzzzz

    • @BloxyDev
      @BloxyDev  ปีที่แล้ว +3

      make it so that when button down shift use movement script with more speed

    • @drakefire98
      @drakefire98 ปีที่แล้ว

      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class Movement : MonoBehaviour
      {
      [SerializeField] Transform playerCamera;
      [SerializeField] [Range(0.0f, 0.5f)] float mouseSmoothTime = 0.03f;
      [SerializeField] bool cursorLock = true;
      [SerializeField] float mouseSensitivity = 3.5f;
      [SerializeField] float Speed = 6.0f;
      [SerializeField] [Range(0.0f, 0.5f)] float moveSmoothTime = 0.3f;
      [SerializeField] float gravity = -30f;
      [SerializeField] Transform groundCheck;
      [SerializeField] LayerMask ground;
      public float jumpHeight = 6f;
      float velocityY;
      bool isGrounded;
      float cameraCap;
      Vector2 currentMouseDelta;
      Vector2 currentMouseDeltaVelocity;
      CharacterController controller;
      Vector2 currentDir;
      Vector2 currentDirVelocity;
      Vector3 velocity;
      void Start()
      {
      controller = GetComponent();
      if (cursorLock)
      {
      Cursor.lockState = CursorLockMode.Locked;
      Cursor.visible = true;
      }
      }
      void Update()
      {
      UpdateMouse();
      UpdateMove();
      }
      void UpdateMouse()
      {
      Vector2 targetMouseDelta = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
      currentMouseDelta = Vector2.SmoothDamp(currentMouseDelta, targetMouseDelta, ref currentMouseDeltaVelocity, mouseSmoothTime);
      cameraCap -= currentMouseDelta.y * mouseSensitivity;
      cameraCap = Mathf.Clamp(cameraCap, -90.0f, 90.0f);
      playerCamera.localEulerAngles = Vector3.right * cameraCap;
      transform.Rotate(Vector3.up * currentMouseDelta.x * mouseSensitivity);
      }
      void UpdateMove()
      {
      isGrounded = Physics.CheckSphere(groundCheck.position, 0.2f, ground);
      Vector2 targetDir = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
      targetDir.Normalize();
      // Check if sprinting
      float currentSpeed = Input.GetKey(KeyCode.LeftShift) ? Speed * 2f : Speed;
      currentDir = Vector2.SmoothDamp(currentDir, targetDir, ref currentDirVelocity, moveSmoothTime);
      velocityY += gravity * 2f * Time.deltaTime;
      Vector3 velocity = (transform.forward * currentDir.y + transform.right * currentDir.x) * currentSpeed + Vector3.up * velocityY;
      controller.Move(velocity * Time.deltaTime);
      if (isGrounded && Input.GetButtonDown("Jump"))
      {
      velocityY = Mathf.Sqrt(jumpHeight * -2f * gravity);
      }
      if (isGrounded && controller.velocity.y < -1f)
      {
      velocityY = -8f;
      }
      }
      }
      heres the full code with sprinting implemented

  • @Many.manmenwithotherman
    @Many.manmenwithotherman ปีที่แล้ว

    All of the tutorials on 1st person movement have not worked and this dont work pls help

  • @locodiamind
    @locodiamind ปีที่แล้ว

    I need help when i walk it doesn't let me turn how do i fix that.

  • @medic_male07
    @medic_male07 ปีที่แล้ว

    the link its not functioning, and im new, so i'll need to pause and copy the script?

  • @DumClothing
    @DumClothing ปีที่แล้ว

    I feel stupid. I'm just trying to make my first game and it doesn't give me the options for jump height or speed or any of that stuff, if anyone else got this problem or they know what's happening pls help me.

  • @OfficialMarkVR
    @OfficialMarkVR ปีที่แล้ว

    W Movement

  • @g0uzi
    @g0uzi ปีที่แล้ว +1

    Thanks

  • @nbdsnipez5403
    @nbdsnipez5403 ปีที่แล้ว +1

    jump dont work

  • @sneakysquid-tt3ef
    @sneakysquid-tt3ef ปีที่แล้ว

    THANK YOU SO MUCH OMG I FINALY AFTER SO MANY TRYS YOU HELPED ME AND GOT IT TO WORK YESS😁😁😀😀

  • @felixkostur723
    @felixkostur723 ปีที่แล้ว

    Thx I have been looking for a tutorial thats works for the walking script and the camera You earned a subscriber from me. Im suprised that it only got 670 when it shued of hade like 3-4 thousand Likes it was a Great tutorial. :)

  • @joft7141
    @joft7141 9 หลายเดือนก่อน

    goat

  • @drakefire98
    @drakefire98 ปีที่แล้ว

    im getting compiler errror and its not letting me put in my player i copy pasted from one of thing in the comments and for everyone else it worked

    • @drakefire98
      @drakefire98 ปีที่แล้ว

      found the problem used chat gpt to find out
      In the line if (isGrounded! && controller.velocity.y < -1f), there is an exclamation mark (!) after isGrounded, which is causing a syntax error. You need to remove the exclamation mark to fix the error. The corrected line should be: if (isGrounded && controller.velocity.y < -1f).
      The code references a variable isGrounded! in the line if (isGrounded! && controller.velocity.y < -1f), which doesn't exist. This is likely a typo. You can remove the ! to fix the error. The corrected line should be: if (isGrounded && controller.velocity.y < -1f)
      also had another spare code with different movement method that caused a second error try to fix these to see if it works lol

    • @Al-tt6tj
      @Al-tt6tj 9 หลายเดือนก่อน

      @@drakefire98 you want the (!) just on the other side of the variable