First Person Movement Unity 2022

Поділитися
Вставка
  • Опубліковано 4 жов 2024
  • Todays video is all about making a fun to use and highly tweakable 3D movement system in unity.
    First Person Movement Unity 2022
    Code:
    pastebin.com/d...
    Remember to subscribe and hit that bell to always stay notified.
    Go check out my other videos:
    / bloxydev

КОМЕНТАРІ • 263

  • @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 13 днів тому +2

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

  • @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.

  • @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

  • @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

  • @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!

  • @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!!!

  • @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

  • @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!!!

  • @toast9092
    @toast9092 9 місяців тому

    I have come across many player controller tutorials in my time and this was the only one that worked. So thank you!

  • @BMCJuicyG
    @BMCJuicyG 9 місяців тому +2

    One last chicken very crispy

  • @kudenokkaelain6026
    @kudenokkaelain6026 5 місяців тому +1

    First actually GOOD tutorial I found. Amazing work.

  • @rekkimaru7
    @rekkimaru7 2 роки тому +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 роки тому +2

      Well I'm glad I could help!

  • @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

  • @demizx
    @demizx Рік тому +4

    bro is underrated , nice video

  • @Gneey2Smooth
    @Gneey2Smooth Рік тому

    Works in 2023! Very helpful video much appreciated

  • @nerbsquid
    @nerbsquid Рік тому

    this was overrall the best tutorial on character controller movement, Thank you so much!

  • @Shimneydust
    @Shimneydust Рік тому

    I have watched like 4 diffrient movement tutorials, some didnt even work but this was the best.

  • @OfficialKaiVerse
    @OfficialKaiVerse 11 місяців тому +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?

    • @IshallDEEESTROY
      @IshallDEEESTROY 4 дні тому

      @@beau_mom3079 use this code:
      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;
      }
      }
      }

    • @IshallDEEESTROY
      @IshallDEEESTROY 4 дні тому

      it only fixes the bit where if you stop jumping it wont let you jump again till you touch the ground

  • @beefytime1374
    @beefytime1374 Рік тому +2

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

  • @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

  • @aaravponnapalli3007
    @aaravponnapalli3007 27 днів тому

    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 :)

  • @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

  • @rotemoron8213
    @rotemoron8213 Рік тому

    Thank you so much, I had so much trouble but this video literally solved all my problems, subed and liked.

  • @TristinOnFoNem
    @TristinOnFoNem Рік тому

    That you so much man I been trying to do it for a while until I found this wonderful video-Thanks so much 🎉🎉🎉

  • @supermelon80
    @supermelon80 Рік тому

    This tutorial helped ALOT. Thanks for helping!

  • @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?

  • @raptorclawVR
    @raptorclawVR 6 місяців тому

    This tutorial was amazing, thank you so much!!!!

  • @game_time2Official
    @game_time2Official 6 місяців тому

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

  • @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;
    }
    }
    }

  • @Fajnosis120
    @Fajnosis120 Місяць тому

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

  • @Aovri
    @Aovri 9 місяців тому +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

  • @FactuallyWOW
    @FactuallyWOW Рік тому +1

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

  • @runrajrun
    @runrajrun Рік тому

    I've been looking for a 1st person character controller for ages and yours is by far the best one I have come across in terms of ease of use! Thanks a ton :D
    Also more tutorials coming hopefully?!

  • @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. :)

  • @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?

  • @sneakysquid-tt3ef
    @sneakysquid-tt3ef Рік тому

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

  • @coolgamermc2171
    @coolgamermc2171 Рік тому +1

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

  • @benrafter7902
    @benrafter7902 Рік тому

    Short and sweet, thank you!

  • @AndrewGrimm-w5d
    @AndrewGrimm-w5d Рік тому +1

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

  • @jaylindowney9757
    @jaylindowney9757 4 місяці тому

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

  • @adude200
    @adude200 Рік тому

    hippity hoppity your code is now my property

  • @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

  • @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 ?

  • @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 "

  • @Insertmorecoins1
    @Insertmorecoins1 4 місяці тому

    Great great video, my dude

  • @BloxyDev
    @BloxyDev  2 роки тому +3

    Hope you enjoyed!

  • @gquarkie1073
    @gquarkie1073 7 місяців тому

    Thank you so much, you helped alot!

  • @NotWez_
    @NotWez_ 11 місяців тому

    wow amazing so easy and I will make sure to remember this

  • @adisendo6069
    @adisendo6069 Рік тому

    U are god. Finally someone with working script + i can turn off the smooth time

  • @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.

  • @Polski-Patriota-No
    @Polski-Patriota-No Рік тому

    Thank you so much , it worked!!!

  • @piecehacking7090
    @piecehacking7090 Рік тому

    Why are you not famous?
    edit: Thx bro it worked

  • @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

  • @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

  • @flamingpower
    @flamingpower Місяць тому +1

    Thanks boss! 🦍

  • @StupidJellyfish
    @StupidJellyfish 7 місяців тому

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

  • @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

  • @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

  • @good_noodlewastaken
    @good_noodlewastaken Рік тому +1

    my jump doesnt work for some reason

  • @Beans-u3s
    @Beans-u3s 2 дні тому

    thank you so much

  • @tedivbg3354
    @tedivbg3354 Рік тому +1

    thx man im ten but i know unity

  • @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

  • @droiddomainofficial
    @droiddomainofficial 2 місяці тому

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

  • @_Pollard_
    @_Pollard_ Рік тому

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

  • @AhmedSw-p6y
    @AhmedSw-p6y Рік тому +1

    best movment script video ever

  • @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❤❤

  • @Inky_puppets
    @Inky_puppets 7 місяців тому

    can you make a tutorial for a wall jump

  • @Many.manmenwithotherman
    @Many.manmenwithotherman Рік тому

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

  • @asriel_dreemur_fan
    @asriel_dreemur_fan Рік тому

    I keep teleporting through the ground when i got near some of the cubes i placed

  • @mello76_fri43
    @mello76_fri43 Рік тому

    When i jump my camera just falls through the ground

  • @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.

  • @DeagleAssault
    @DeagleAssault Рік тому

    my guy falls over for every movment

  • @skebleton
    @skebleton 10 місяців тому

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

  • @svrge3092
    @svrge3092 Рік тому

    BEAN, i miss danny

  • @zipey2453
    @zipey2453 8 днів тому

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

  • @Takhooo
    @Takhooo Рік тому

    Do you have any Idea how to make it so you can jump while running on a downslope ?

  • @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

  • @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.

  • @tankssmusic
    @tankssmusic Рік тому

    i added a grapple gun and when i shift it messes it up so how do i turn shift off?

  • @sdsdfdu4437
    @sdsdfdu4437 Рік тому

    You didn't make a character controller you just used the one provided by default

  • @PrinceVegetable
    @PrinceVegetable Рік тому

    Where do I write the code, I can’t open the script Bcus it asks to open notepad or unity editor

  • @amerhammam1041
    @amerhammam1041 Рік тому +1

    Running and sliding please

  • @draconicstudios368
    @draconicstudios368 11 місяців тому

    Will you ever make a sprinting tutorial using this script?

  • @Buford4
    @Buford4 Рік тому

    error CS0103: The name 'Nameof' does not exist in the current context

  • @thenonhuman9593
    @thenonhuman9593 Рік тому

    I tried 5 tutorials on how to do this and even this one Didnt work do you know why and can u help me ?

  • @honeybunbandit568
    @honeybunbandit568 Рік тому

    The camera works but i cant actually move am i missing something?

  • @omerkayradelikara9513
    @omerkayradelikara9513 Рік тому

    1:05 tysm

  • @mrmagmapt3216
    @mrmagmapt3216 Рік тому +1

    The Jump part for me inst working

    • @moonsnowtv429
      @moonsnowtv429 Рік тому

      make sure to have the ground layer to ground and default

    • @goofysongs1722
      @goofysongs1722 Рік тому

      @@moonsnowtv429 ?

    • @moonsnowtv429
      @moonsnowtv429 Рік тому

      @@goofysongs1722 like i said, use default as ground layer, but also use your platform as ground layer

    • @Musabuluut2013
      @Musabuluut2013 Рік тому

      @@moonsnowtv429 how

    • @moonsnowtv429
      @moonsnowtv429 Рік тому

      @@Musabuluut2013 I have no idea anymore, I went to Unreal Engine because that is way new user friendly

  • @nbdsnipez5403
    @nbdsnipez5403 Рік тому +1

    jump dont work

  • @swe_robbe3006
    @swe_robbe3006 5 місяців тому

    The player falls through the ground what should I do

  • @PixRaggamer
    @PixRaggamer 6 місяців тому

    wheres the ground check?

  • @locodiamind
    @locodiamind Рік тому

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

  • @marcoraimondo5420
    @marcoraimondo5420 4 місяці тому +1

    whos this absolute cutieeeee

  • @O44D6C
    @O44D6C Рік тому

    jump dont work i add ground to ground layer and to script and still

  • @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

  • @lettuce1355
    @lettuce1355 Рік тому

    Quick question, how can i add sprint?