Character Controller Tutorial in Unity | AshDev

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025

Комментарии • 42

  • @artemussapphire2108
    @artemussapphire2108 3 месяца назад +2

    Man, this was great. Basic, easy to setup, and scaleable. I definitely will be using this to build my first real movement system :D

  • @TheSparkoi
    @TheSparkoi 8 месяцев назад +2

    im a big fan of all your work/script !!! Keep the good work ! lov u

  • @isglazunov
    @isglazunov 21 день назад +1

    Great tutorial!

  • @ragerungames
    @ragerungames 8 месяцев назад +3

    Nicely explained as always!

  • @celestialvamp
    @celestialvamp 5 месяцев назад +5

    If anyone wants to make it so that the diagonal speed is the same as the horizontal and vertical speeds, make sure to normalize the movement vector in the GroundMovement() function, so: Vector3 move = new Vector3(turnInput, 0, moveInput).normalized; . Also if you notice that there is a sliding/smoothing effect to your character after normalizing the movement vector, all you have to do is GetAxisRaw instead of GetAxis in the InputManagement() function.

  • @TheSixoul
    @TheSixoul 4 месяца назад +7

    I'm surprised people are still making videos without the "new" input system.

    • @ashdev
      @ashdev  4 месяца назад +3

      We'll make a seperate video on new inputs system, then you can add it wherever you want

  • @kagunslinger767
    @kagunslinger767 8 месяцев назад +1

    Nice tutorial, as always !

  • @jackcampbell3939
    @jackcampbell3939 12 дней назад +1

    Everything was working until 6:50, unity says that the forward in camera.forward isn't defined (sorry if this is simple, I just started using c#/unity) Do you have any solutions?

    • @EmersonLovatt
      @EmersonLovatt 12 дней назад +1

      do you have "[SerializeField] private Transform camera;" under the references header? that's the only cause I can think of.

    • @jackcampbell3939
      @jackcampbell3939 11 дней назад

      @@EmersonLovatt Thank you so much!!!

  • @Ollive24
    @Ollive24 8 месяцев назад +3

    best channel

  • @1playfair
    @1playfair 5 месяцев назад +1

    Thank you good work

  • @darksapphire6829
    @darksapphire6829 12 дней назад +1

    How do I add the 2 straight lines at 7:32?

  • @frostfire2884
    @frostfire2884 Месяц назад +1

    I HAVE FOUND GOLD

  • @itzundead1240
    @itzundead1240 3 месяца назад +1

    Hey guys if you found that your charactercontroller.isgrounded is not stable. make sure that the verticalvelocity when being grounded is less than 0. You could write just -1 or maybe something like verticalVelocity = -gravity * 0.1f;

  • @indianapapi
    @indianapapi 2 месяца назад +1

    Just FYI the CinemachineFreeLook is deprecated

  • @StigDesign
    @StigDesign 8 месяцев назад +2

    Nice :D

  • @charmander_004
    @charmander_004 Месяц назад +1

    great tutorial! I am having an issue though where the sprintSpeed is also effecting the jumpHight. when I press left shift I can run faster but I also jump higher even when im standing still. is this supposed to happen? if not how do i fix it?

    • @ashdev
      @ashdev  Месяц назад +1

      It's not supposed to happen, please join our discord server and share the code snippet.

  • @jeanmakesgames
    @jeanmakesgames 3 месяца назад +1

    in Unity 6 preview, when you change in GroundMovement the move.y value to anything else than 0 the character tip over, stopping the possibility to jump, do you have a fix for that please?

  • @JayRKID
    @JayRKID 7 месяцев назад +1

    Looking forward to the animation update :)

    • @ashdev
      @ashdev  7 месяцев назад +2

      The animations tutorial have been uploaded, check it out 🙂

    • @JayRKID
      @JayRKID 7 месяцев назад +1

      @@ashdev nice, thankyou

  • @jackstacey8087
    @jackstacey8087 8 месяцев назад +1

    Hi, when I use the controller the character jumps up

  • @vaibhavjaiswal799
    @vaibhavjaiswal799 8 месяцев назад +1

    I have a question. So you said you will use kinematic approach and use Character controller component. So what's the difference if we use character controller component or Rigidbody with kinematic checkbox set to true...?

    • @ashdev
      @ashdev  8 месяцев назад

      It's more complex hence prone to errors and less efficient. You have to code each and everything.
      It's recommended to use, if you want to do some physics calculations or collision detections etc.
      It's in between of using a fully physics based character controller and going with fully kinematic one (like built in character controller component).
      Built in character controller is more efficient and already has basic functionalities.
      These are all the things to consider before choosing one.

  • @WORSTXD001
    @WORSTXD001 8 месяцев назад +1

    hey Ash Dev,
    when i wrote the player controller script and loaded unity again it was showing a error saying
    Assets\player controller(38,25):error CS1002: ; expected
    what do i do now please help me

    • @ashdev
      @ashdev  7 месяцев назад +2

      You have to add " ; " at the end of each line of code, that's what this error is for

  • @jamestanubrata6782
    @jamestanubrata6782 8 месяцев назад +2

    Thats awesome, also how do you make when making character controller that is like animal like a dog or snake or bird

    • @ashdev
      @ashdev  8 месяцев назад +1

      For basic one, it's the same, the difference will only be in the animations. (For dogs, cats etc). But you won't be able to use the built in character controller because of the capsule collider you have to create a custom one but the approach will be same.

  • @AbdullahGameDev
    @AbdullahGameDev 8 месяцев назад +2

    Great video
    I would like to ask about the asset name you used in this video?

    • @ashdev
      @ashdev  8 месяцев назад

      What asset?

    • @AbdullahGameDev
      @AbdullahGameDev 8 месяцев назад

      @ashdev 9:34 the plane and cubes is that asset on unity asset store or you made it?

  • @Hunter-X9211
    @Hunter-X9211 8 месяцев назад +4

    Hello,
    How can we add dash function in this code ??..

    • @ashdev
      @ashdev  8 месяцев назад +1

      Just like sprinting, you can create a different speed and and set the current speed to that for your appropriate dash time and trigger it through some button (For basic approach). And then, add some kind of cool down timer so that, the player doesn't keeps on moving with the dash speed.

  • @sakibrahman-ot7ck
    @sakibrahman-ot7ck 3 месяца назад +1

    Your script is buggy,I tried and it didnt work

    • @ashdev
      @ashdev  3 месяца назад +1

      Please follow the tutorial carefully, and if you still face the issue share the issue in are our discord server.

  • @creative.outlet
    @creative.outlet 8 месяцев назад +2

    This was great! Thanks!
    Is there a reason why you didn't use the new Input System?

    • @ashdev
      @ashdev  8 месяцев назад +2

      New input system is a whole different topic to explain, and it's not a good idea to explain two different things simultaneously.
      We'll cover it in some future tutorial.