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

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

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

  • @JoshTheGiff
    @JoshTheGiff 9 месяцев назад +2

    I haven't been able to understand the new input system at all. This video has made things click. Thank you so much!!!!

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

    posting this here just in case someone new to unity like myself had the same issue: when coding in visual studio, if it's not recognizing code like "rigidbody" and helping autocomplete, here' s fix: in Unity select Edit>preferences>External Tools> then choose visual studio as the default. start your visual studio page back up and the problem is fixed!

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

      Thanks for sharing 😊

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

      Bro it is still not giving me the suggestions and also not helping me in auto completing :(

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

      Thanks so much for this

  • @gazzer4461
    @gazzer4461 2 года назад +7

    Thanks Ketra!
    I appreciate all your hard work on these tutorials.

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

      Thanks very much for this comment 😊

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

    OMG! I watched older videos and I can't imagine why they were not working, but TY for this!!!!

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

    Nice. I'm glad to used the new input system

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

    Thank you very much for explaining about new input system and for using it at this project! It was very helpful.I don't think I would have been able to figure this topic out by myself in the near future without your help, thanks

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

    DEFINITELY doing this! I've learned how to make an inventory system but this will definitely help me Advanced into a whole other area for I can add it to my game :3 I hope I dont run into many issues but cant wait to go onto this journey!

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

    thank you, glad that you show good programming practices, because I am a begginer in unity and only recently I discovered a [SerializeField] attribute, and all other tutorials are skipping such things and use all public variables, and it's just one example, I also keen to learn about underscores in the variables names.

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

    Thank you very much for this tutorial series!

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

      Glad you're finding it useful 😊

  • @Rejonshon
    @Rejonshon 6 месяцев назад +1

    there was an error when I added the serialized field
    it says. Assets\Script\game\player\playermovement.cs(8,6): error CS0246: The type or namespace name 'serializedfield' could not be found (are you missing a using directive or an assembly reference?)

    • @Rejonshon
      @Rejonshon 6 месяцев назад

      wait, I know the problem. The problem is just because I added a d in the word serialize

  • @Basedeath
    @Basedeath Год назад +3

    Why the fufk can't I get this to work. I did this the other day and got it working trying the same now and it just moves on its own and doesn't register inputs.

  • @_Garm_
    @_Garm_ 2 года назад +3

    great tutorial, others seems to over complicate this part :)

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

      Thanks, great to hear 😊

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

    for those who need it if the movement is not working try this 1. Verify Setup:
    Input System:
    Make sure you’ve installed the Input System package via Window > Package Manager.
    In Edit > Project Settings > Player, set Active Input Handling to Both or Input System Package (New).
    Restart Unity.

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

    Ty! Nice tut as always:)

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

    Wow I am very impressed with your didatic skills, I love how you make things easy to understand!!! thanks u deserves the best!!!

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

      Thanks very much for this comment 😊

  • @GARL0CK
    @GARL0CK Год назад +11

    Hi Ketra! I have a tiny request - can you number the videos in the Tutorial playlist in the order that we should be watching them? I've been through 2 videos before I figured out that the list is in a random order. I figured it out by opening the list and looking a the upload dates.
    Thanks, love the videos!

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

    Hey, I cant find 2D URP is it outdated? can i just use 2D Universal?

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

    Thank God! Thank you for this!

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

      Glad it was helpful 😊

  • @ftrwar
    @ftrwar 7 месяцев назад

    awsome video sofar

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

      Thanks for this comment 😊

  • @potatoeaII
    @potatoeaII 6 дней назад +1

    for who is getting 12 errors ate the script, make sure that the awake it's Awake with an uppercase in the first letter and a () after Awake

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

    utilizing this method works, but auto switching of control schemes doesn't seem to be working. If I set default to my gamepad, it works but M+K doesn't and visa versa. setting default to will make only M+K work. Any ideas?
    Fixed: If you have more than one PlayerInput in the scene it seems to have issues. Not sure if this will be an issue as the project scales.

  • @cerritosrules
    @cerritosrules 10 месяцев назад

    is it possible to add a joystick to this for mobile games?

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

    Mines not even registering MonoBehaviour and various other using functions, have c# installed. What have I done wrong?

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

    thankyou so much this helped a lot

  • @nadavulitsky6450
    @nadavulitsky6450 10 месяцев назад

    void OnMovement(InputValue Move)
    {
    Movement = Move.Get();
    }
    doesn't work, what is the issue and how do i fix it?

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

    my sprite seems to wobble when going diagnoly any fix?

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

    Hey there! Can I also use 2d mobile instead of 2d URP for this tutorial. I want to make a mobile game. Thanks!

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

    Mine works all the way up to the player input part then it Gives me these errors
    The type or namespace name 'ImputSystem' does not exist in the namespace 'UnityEngine'
    The type or namespace name 'ImputValue' could not be found
    The type or namespace name 'SerializeFeildAttribute' could not be found
    The type or namespace name'SerializeFeild' could not be found

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

      Hi, check that you have the new Input System package installed from the Package Manager Window. Hope that helps 😊

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

      @@KetraGames I already have that installed but thank you.

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

      You spelled everything wrong. Input not 'imput'. Field not 'feild'.

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

    ok how does your visual studio open that fast i have aged by 5 years waiting on mine

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

      😂
      It's all an illusion! We usually have it already opened in the background or we speed it up in the video editing.

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

    You should do a 2d platformer series like Super Mario Bros.

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

    IDK what I'm doing wrong but I just can type 'private' when coding. It just don't show the code. I wasted 3 days already trying to make this thing work and I can't get it :S

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

    It just says all error complients haveto be fixed

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

    Hello I'm looking for old game on windows, i remember only graphic is like GTA2 top down, But there is only shooting from cars guns, grenades, bazooka. one map is like Texas on the desert, Story was about Revenge on Gangsters for Brother death, every boss death had scene, last boss look is Long blonde hair mustache and last boss ending: he is half death and was doused in Tequila and set on fire

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

    any idea why my variables are showing up in Inspector?

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

      Hi, fields should only show in the Inspector if you've made them public or they have the SerializeField attribute. Hope that helps 😊

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

    Why do a lot of people leave the Rigidbody as Dynamic instead of Kinematic?

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

      Hi, while Kinematic Rigidbodies might give you more direct control of the movement, they have limitations when it comes to collisions. The biggest issue is that they don't detect collisions with static objects, so will pass through obstacles.

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

      @@KetraGames Isn't that what the full kinematic control option is for?

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

      @Cory Pelizzari As far as I'm aware the 'full contact' option will cause it to trigger the collision events with static objects such as OnCollisionEnter2D but it won't actually stop the movement, so a kinematic Rigidbody will still pass through a static obstacle, unless you stop the movement yourself in OnCollisionEnter2D.

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

      @@KetraGames Ah, I see now. Thanks.

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

    Is there any plans to update your 3d tutorial vids or make new ones? I like your voice

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

      Hi, yes, we still plan to continue with the 3d videos. We have a third person shooter series in the works and plans to refresh/continue the 3d platformer series

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

      @@KetraGames ok cool. i just made the jump to 3d and im tryna learn the unity engine.

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

    Hi Ketra, Thanks for this tutorial, you realy explain everything very clearly. I followed your instructions step by step, however, the character don't move and i don't know why.

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

      hello, i have the same problem. did you find a solution

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

      @@punisher6467 i used a different method to do it

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

      @@francescoderosa1230 can you tell me ?

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

      @@punisher6467
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using UnityEngine.InputSystem;
      using UnityEngine.InputSystem.Controls;
      public class PlayerMovement : MonoBehaviour
      {
      public float _Speed;
      public Rigidbody2D _rigidbody;
      Vector2 movement;
      public Animator animator;
      private void start()
      {
      _rigidbody = GetComponent();
      }
      private void Update()
      {
      animator.SetFloat("Horizontal", movement.x);
      animator.SetFloat("Vertical", movement.y);
      animator.SetFloat("Speed", movement.sqrMagnitude);
      movement.x = Input.GetAxisRaw("Horizontal") * _Speed;
      movement.y = Input.GetAxisRaw("Vertical") * _Speed;
      }
      private void FixedUpdate()
      {
      _rigidbody.MovePosition(_rigidbody.position + movement * _Speed * Time.fixedDeltaTime);
      }
      }

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

      @@francescoderosa1230
      thank you but it didn't work. Still not moving

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

    gotta get those ads in huh

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

    Спасибо! Не без труда, но смог разобраться, и всё получилось как на видео!👍❤

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

    nc watched 4 videos, and alll have different ways to do things

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

    its not working

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

    Why 2D URP?

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

      Hi, we chose URP as we want the series stay current as long as possible, and Unity are trying to phase out the Built In Render Pipeline. Most of the series will work just fine using the Built In though

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

      @@KetraGames thank you

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

    Unity 3d is the best

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

      We like 3D as well, but we'll make sure we cover lots of things in this series that will be applicable to 3D games as well 😊

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

    😈🤘

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

    bruh

  • @v1ncecuhbutiknowwhereulive402
    @v1ncecuhbutiknowwhereulive402 2 года назад +3

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class playermovment : MonoBehaviour
    {
    private Rigidbody2D _rigidbody;
    private void awake()
    {
    _rigidbody = GetComponent();
    }

    private void FixedUpdate()
    {
    _rigidbody.velocity = new Vector2(1, 0.5);
    }

    }
    here is ofing the code

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

      and btw why is it not working?!!!

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

      @@v1ncecuhbutiknowwhereulive402 I'm about as much of a noob as you, but one thing i notcied about your code is you dont have the letter "f" after 0.5
      Not sure if that helps.