Smooth 2D Movement Using the New Input System (Unity Tutorial | 2D Top Down Shooter)

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

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

  • @nightlifekid7843
    @nightlifekid7843 2 года назад +5

    Looking forward the next parts. I just spendet hours on just finding something like this. And it is easy, perfect and slim coded.
    Thank you so much!

    • @KetraGames
      @KetraGames  2 года назад +2

      Thanks so much for this comment 😊

  • @pr4shantishere
    @pr4shantishere 2 года назад +4

    this video is pretty smooooooooooooth

  • @jasonwilliams8730
    @jasonwilliams8730 2 года назад +2

    Great video as always!

  • @davidalvareztorres5324
    @davidalvareztorres5324 Месяц назад

    Awesome video!
    It was exactly what I needed. Thanks!

  • @zendraw3468
    @zendraw3468 2 года назад +2

    good job, waiting for the next

  • @pgmtls
    @pgmtls 2 года назад

    Thanks for these videos. Clear and easy to understand instructions, and well spoken which really helps. This is about the 10th video I watched with a great deal of newby frustration, all because my Unity and Visual C# setups were incorrect. I finally decided it was probably my setup, and not all the content providers out there. Anyhow, I would recommend for anyone making vids for beginners that you either have a basic setup video or add links to existing resources to help ppl avoid the same frustrations. In my case (after many hours of searching), I had to do the following, since many instructional videos were not working for me: In Unity Editor: Edit -> Preferences... -> External Tools -> Regenerate project files. Solved all my problems but I'm sure there are several other beginner tips that will help keep viewers at your channel instead of just moving on and assuming your instructions don't work for them.

    • @KetraGames
      @KetraGames  2 года назад +1

      Hi, glad you found the videos useful. Sorry you had issues getting started but thanks for sharing your solution 😊

  • @dkicksolon2502
    @dkicksolon2502 15 дней назад

    if your sprite comes out a little blurry you can adjust the compression to none and the Filter Mode to Point (no filter) . These are located in the inspector when u click the file that your sprite image is on

  • @dreambadger
    @dreambadger 2 года назад

    These are pretty good tutorials, cheers.

  • @frizzlefry176
    @frizzlefry176 2 года назад

    thanks for making it so simple!

    • @KetraGames
      @KetraGames  2 года назад

      Glad you found it useful 😊

  • @blankspace4293
    @blankspace4293 Год назад +1

    Hello, I want to start by saying thank you for the comprehensive tutorial. I am a bit confused with the SmoothDamp method, I understand most of it and how it works but I am confused about why you added the reference to the _movementInputSmoothVelocity. Not sure if you respond to comments still but if so it would help a lot. Thanks!

    • @KetraGames
      @KetraGames  Год назад +1

      Hi, the SmoothDamp method needs to keep track of the velocity to apply the damping. It needs to be a ref so that it can update the value each frame. Hope that makes some sense 😊

    • @blankspace4293
      @blankspace4293 Год назад

      @@KetraGames Thanks for the clarification :)

  • @Сказочник-м2ц
    @Сказочник-м2ц 2 года назад +2

    Cool!

  • @stefan429
    @stefan429 2 года назад +2

    why not add force to the rigidbody and let it slow down on its own? i.e. let physics slow it down instead of smoothing the input

    • @KetraGames
      @KetraGames  2 года назад +2

      Good question. You could create the same effect with forces and that's definitely a valid option. It's really down to personal preference, but we chose to go this way for a few reasons.
      1. The old input system has a Gravity setting that smoothed the input and we wanted to try to replicate that.
      2. This way would work if you weren't using a Rigidbody. For example, in a 3d game using the Character Controller component.
      3. Working with velocity tends to require a bit less trial and error than trying to balance forces and drag.

    • @alexba838
      @alexba838 2 года назад

      @@KetraGames Good afternoon, I have a question. The character has an animation of interaction with the environment, he needs to open the chest. But we can approach the chest from any side, even to the left, even to the right, and the opening animation must be started strictly from one position. How to correctly move the character from the current position to the animation start position? Use inversion kinematics + pathfinding or are there other ways?

  • @MilMar24
    @MilMar24 10 дней назад

    I did everything and everything works except my inputs are inverted, so W will make the player go down, S up, A to the right and D to the left. Any suggestions?

    • @MilMar24
      @MilMar24 10 дней назад

      this comment was mentioning the previous video, where you set up the playermovement script

  • @hiyesimhi
    @hiyesimhi Год назад +1

    the script is not working for me please help it says inputValue cannot be found

    • @MorotiAdegboyegaNotMoroti
      @MorotiAdegboyegaNotMoroti Год назад

      I know i am REALLY late but if you still need it you need to install the Input system from the package manager(and restart unity) and everything should work, make sure to do "using UnityEngine.InputSystem"

  • @zhoking0075
    @zhoking0075 2 года назад +1

    you can take a video, how to create loot box and take item its so cool

  • @agnesserdechny7480
    @agnesserdechny7480 4 месяца назад

    By the the way ho has problems with strange sliding ,make the "Angular Drag" higer

  • @tiberionx
    @tiberionx Год назад

    Thanks for the tutorial Can someone Help in translating the controls to tank controls please?

  • @DepresyonSepeti
    @DepresyonSepeti Год назад

    i have a problem. despite the fact that I press no buttons, the character drifts down by itself in a slow way. what is the solution to this?

    • @KetraGames
      @KetraGames  Год назад

      Hi, if you click on the Player in the Hierarchy and look in the Inspector, is the Gravity Scale value of the Rigidbody 2D set to zero?

  • @LiminalDreams91
    @LiminalDreams91 9 месяцев назад

    Hello, I know this is an older video in the series, but after going back and forth through them all I've come to find that perhaps it's this causing my issue - but basically, when my character collides with enemies, and after shooting them a bit, I start to spin around in place slowly, without any inputs, I've tried disabling colliders on my character but it doesn't seem to change anything, plus if I do enemies just walk through me which is not ideal.
    Could it be this smoothing or am I missing something entirely, I hope yourself or someone sees this!

    • @KetraGames
      @KetraGames  9 месяцев назад

      Hi, I think this is Unity's physics system making it spin. You could try increasing the mass or the angular drag value of the Rigidbody2D component to reduce the amount of rotation caused by collisions. You could also try setting the angular velocity to zero in a script in the FixedUpdate method. Hope that helps 😊

  • @classysoda
    @classysoda 2 года назад

    hello do you have a code for the enemies die when it shoot?

    • @KetraGames
      @KetraGames  2 года назад

      Hi, we're working on the shooting video at the moment 😊

  • @superdahoho
    @superdahoho Год назад

    I don't understand the pixels per unit part.
    shouldn't more pixels in a unit make it bigger? because it takes more pixels to construct 1 sprite.
    I can't wrap my around around the logic that less units make it bigger.

    • @KetraGames
      @KetraGames  Год назад +1

      Hi, let's say you had a sprite that was 10x10 pixels. If you set the pixels per unit to 10, then exactly one instance of the sprite would fit in a Unity unit. If you increased the pixels per unit to 20, you would now be able to fit twice as many pixels in a unit, so you could fit four sprites, each one half the size. Hope that helps 😊

  • @louloudepomeranie
    @louloudepomeranie 2 года назад

    Is using SmoothDamp the proper way in 2023 versus adding a force ?

    • @KetraGames
      @KetraGames  2 года назад +1

      Hi, adding forces is still fine if it gives the movement you want. We chose to set the velocity directly as we wanted more control of the speed.

  • @Brandon12983
    @Brandon12983 11 месяцев назад

    Set float smooth time to 0.9f to get an ice skating police officer

  • @Ziplock9000
    @Ziplock9000 Год назад

    Sorry to tell you but it's not smooth, you can visibly see jerky micro-stutters in this video

    • @KetraGames
      @KetraGames  Год назад +2

      Hi, try setting the Interpolate value on the Rigidbody to 'Interpolate'. That should improve the micro stutters

    • @dkicksolon2502
      @dkicksolon2502 15 дней назад

      Sorry to tell u but this is not how u ask for help on YOUR problem...... not hers lol holy hell. Video works perfectly if you listen and follow instructions properly. live long and prosper my friend