Player Movement with Unity Input System - Top Down Unity 2D #1

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

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

  • @GameCodeLibrary
    @GameCodeLibrary  9 дней назад

    Check out the full tutorial playlist📋: ruclips.net/p/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP
    Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template
    Get all source code‼: www.patreon.com/c/GameCodeLibrary
    Enjoy!!

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

    Great concise tutorial, looking forward to continuing with the series!

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

    Another fire video. That ending music just bring nostalgia. Keep at it!

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

      Thank you!! The end music is cozy right! It's from a pokemon mystery dungeon game - which I've only played one of way back when I was young haha! Just found it when looking for a new theme to use online :-)

  • @flaminganusforge
    @flaminganusforge 25 дней назад

    I wish more tutorials were like this. thank you.

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

    Something to keep in mind when using the `Update()` function in unity, is `Time.deltaTime()`. You'll want to multiply by that when moving your player around to keep the experience smooth across multiple systems whose specs may differ and effect the framerate. Really like the format of your videos and your energy. Thanks so much!

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

    I've been looking for some help with the "new" input system, this is great, thank you!

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

    Thanks for this video! Im so excited for this top down series 🎉🎉

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

      You're welcome!! The episodes should get more and more exciting as they go along :-)

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

    finally a recent video that works T_T

  • @PrettyPixels1303
    @PrettyPixels1303 2 месяца назад

    Hello! I love this video so far! I am having trouble though at 5:52 , there is no option to press Move :( Do you have any ideas of what I did wrong?

    • @GameCodeLibrary
      @GameCodeLibrary  2 месяца назад

      Sorry for the late reply!!! The only thing I can think of is at 4:40 I import the using UnityEngine.InputSystem;
      Here's the full script from my video :')
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using UnityEngine.InputSystem;
      public class PlayerMovement : MonoBehaviour
      {
      [SerializeField] private float moveSpeed = 5f;
      private Rigidbody2D rb;
      private Vector2 moveInput;
      // Start is called before the first frame update
      void Start()
      {
      rb = GetComponent();
      }
      // Update is called once per frame
      void Update()
      {
      rb.velocity = moveInput * moveSpeed;
      }
      public void Move(InputAction.CallbackContext context)
      {
      moveInput = context.ReadValue();
      }
      }
      Otherwise perhaps Unity Input System didn't download properly! perhaps try redownloading and opening and closing Unity.
      Hope you're well!

    • @RoryA-v2k
      @RoryA-v2k Месяц назад +1

      Did you make sure the move function is set to public?

  • @YDVN
    @YDVN 2 месяца назад

    Hello, i followed this tutorial and the movement works awesome in my game, however, when i build the game to test the game out on my pc (with the .exe ) the controls don't work, nothing happens, there's no error in the console or anything, right now i have the same exact code as you at the end of #2 of this video, so i'm not sure what could be the issue, thanks :)

  • @GiangNguyen-ho5st
    @GiangNguyen-ho5st 7 месяцев назад

    I usually use GetAxisRaw to get instantaneous movement without acceleration or deceleration, does the new input system have an equivalent approach?

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

      The context.ReadValue(); should give you the current value of the input axis without any smoothing, so it should be the same behavior of GetAxisRaw!

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

    when i type input action it is working but in unity it shoves error (there is no red underline under InputAction)

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

      Have you installed the Unity Input System package shown at 2:40?
      What is the error it's showing?

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

      Oh i figured it out. ineeded to add using UnityEngine.InputSystem;

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

      @@adriandvoracek2305 Hurray nice!