2D Top Down Shooting POINT & CLICK Unity Tutorial

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 93

  • @revmatch6r
    @revmatch6r 4 роки тому +22

    Love it. That would have taken me so much longer to figure out than 13 minutes

    • @BMoDev
      @BMoDev  4 роки тому +4

      Appreciate it!

  • @EchoYoutube
    @EchoYoutube 3 роки тому +30

    If your having a problem with the
    "NullReferenceException: Object reference not set to an instance of an object" error,
    roughly around when you make the player shoot for the first time, heres how to fix it.
    This error means that something outside of the code is not being referenced. Usually, when there is an error with the code it wont allow the game to run. If the game is going, but you only get the error when you shoot, that means the reference hasnt been set OUTSIDE of the code.
    Simply put, just go to your player(or whatever is making the error) and make sure everything is synced up with your scripts.

    • @jayd1os400
      @jayd1os400 3 роки тому +7

      I get this error but what do you mean by synced up with your scripts???

    • @carmenjuliarodriguez3221
      @carmenjuliarodriguez3221 3 роки тому

      Thank you so much. I needed that.

    • @sea-jae6237
      @sea-jae6237 3 роки тому

      THANK YOU!!!!!!

    • @stryc.
      @stryc. 2 роки тому

      Thank you!

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

      I love you and want to marry you. Thank you.

  • @stalkerdeb900
    @stalkerdeb900 4 роки тому +11

    Are you planning on making a Video about Enemie Interactions and Health usw? That would be great! Your tutorials are super great btw!
    Have a good Day, Byeeee!

    • @BMoDev
      @BMoDev  4 роки тому +8

      Yup, that's definitely going to get covered soon!

  •  3 роки тому +1

    Space shooter tutorials: 1 hour or come in 6 separate videos
    When I just could make basic shooter movement in 13 minutes!

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

    This is a really great vid man.

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

    So clear and accessible. So much learnt here. Thankyou

  • @mattthebanana
    @mattthebanana 4 роки тому +6

    Please do a top-down melee tutorial

    • @BMoDev
      @BMoDev  4 роки тому +3

      that is definitely in my backlog!

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

    The VS code theme you are using is amazing, what is the name?

  • @l8j951
    @l8j951 4 роки тому +5

    Nice

    • @BMoDev
      @BMoDev  4 роки тому +1

      Very nice

  • @Kai-ss8ke
    @Kai-ss8ke 3 роки тому +2

    Could you show me how to use the particles you used?

  • @jimmyljr95
    @jimmyljr95 4 роки тому +5

    Nice tutorial! I was wondering how this would work for a mobile game? What are your thoughts on this, can you show us? Thanks again!

    • @BMoDev
      @BMoDev  4 роки тому +5

      It'd be pretty easy, instead of checking if you're pressing the mouse button, you could detect tapping on the screen, record the position and register it as a "mouse click". Unity comes with mobile integration, but I probably won't cover it for a bit... eventually tho

  • @flukeycups4502
    @flukeycups4502 2 роки тому +1

    How to get the particle system 12:56 (the one that you dragged into the ImpactEffect). Do we need to download from outside source? And do we need to set up anything on it?

  • @darkflame2848
    @darkflame2848 4 роки тому +1

    Plz help id doenot rotate properly it rotates half than it auto rotate to its place help

  • @MitchIcarus
    @MitchIcarus 3 роки тому +4

    at 7:13 I get the following error in my console:
    NullReferenceException: Object reference not set to an instance of an object
    PlayerController.ProcessInputs () (at Assets/PlayerController.cs:33)
    PlayerController.Update () (at Assets/PlayerController.cs:18)
    line 33 is my weapon.Fire(); code, line 18 is ProcessInputs();
    any help?

    • @MitchIcarus
      @MitchIcarus 3 роки тому +6

      UPDATE: I fixed it I guess? I clicked on my player, and then dragged my weapon in the weapon slot under Player Controller (Script). Is that how I was suppose to fix it?

    • @pugbread2873
      @pugbread2873 3 роки тому +1

      @@MitchIcarus thank you! had the same problem and this worked

    • @aquamoko0664
      @aquamoko0664 3 роки тому +1

      Tysm i sas stuck with this problem for a whole day t’y (:

    • @neatelf9913
      @neatelf9913 2 роки тому

      @@MitchIcarus This worked. This FUCKING worked. If someone who's reading this is using a private GameObject for Weapon instead of public, just use [SerializeField] above/before the object declaration and it will show up in the Inspector.
      e.g: [SerializeField] private Weapon weapon;

  • @nickvullings8728
    @nickvullings8728 3 роки тому +1

    Is there a way to add delay between each shot so my pistol doesnt shoot a beam of bullets when i hold m1

  • @oshimaboyd1919
    @oshimaboyd1919 2 роки тому +1

    Could you make a tutorial on Top Down shooting using arrow keys instead of mouse?

  • @henrrypoop7570
    @henrrypoop7570 4 роки тому +1

    wow

  • @salimmoughrabi603
    @salimmoughrabi603 3 роки тому

    very nice vid man . can you plz make a tutorial where you combine this mechanic and the 8d movement (in your 8d animation vid) so that we get mechanics just like enter the gungeon. im still new to coding and liked your content easy to understand keep it up .

  • @Great-Dao-of-Elegance
    @Great-Dao-of-Elegance Рік тому

    How can I have a different gameobject rotate instead of the player and shoot as well

  • @Bignose_Dev
    @Bignose_Dev 3 роки тому +1

    my player didint have collision why ?

  • @rido3753
    @rido3753 8 місяців тому

    seeing the left side of your screen would have been helpful

  • @domenzigart50
    @domenzigart50 2 роки тому

    for some reason my rb.rotation = aimAngle; doesn't work, It says "=" and ";" are used incorrectly, can you please help

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

    How do I make something other than the player rotate and move along with the player (E.g. a blaster of sorts)?

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

      make it a child of the player and it should work

  • @Yovry
    @Yovry 2 роки тому

    Damn. I'm trying to find a tutorial JUST LIKE THIS for ue4 lol

  • @thenoglinman
    @thenoglinman 2 роки тому +1

    Hi, any thoughts on making a melee version of this. That would really help!

  • @minecraftwithjpizza9929
    @minecraftwithjpizza9929 3 роки тому +1

    My bullet goes up not forwards

  • @crashcode2401
    @crashcode2401 3 роки тому

    WHERE IS PART ONE? Still looking for the first Video part ... XD

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

    Help! There was a error that said "Assets\PlayerController.cs(10,12): error CS0246: The type or namespace name 'Weapon' could not be found (are you missing a using directive or an assembly reference?)", it errored at my script " public Weapon weapon;" any help?

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

      you need to assign the script to it in the editor, as well as making sure your script is named "Weapon"

  • @l.1263
    @l.1263 3 роки тому

    When I move my mouse why does my character move in like massive circles

  • @vvcephie113
    @vvcephie113 3 роки тому +1

    is ther anything wrong with this, It says Missing ";"
    }
    }
    void OnTriggerEnter2D(Collider2D other){
    if(other.CompareTag("Player")); or if(other.CompareTag("Walls"));
    {
    DestroyProjectile();
    }
    }

    • @BMoDev
      @BMoDev  3 роки тому

      yup, compare your if statement to the one in the video

    • @vvcephie113
      @vvcephie113 3 роки тому

      @@BMoDev Thanks!

    • @vvcephie113
      @vvcephie113 3 роки тому

      Could You make a vid about the enemy heath scrip??? I am just learning unity and code. If you could that would be great!

  • @mischa8517
    @mischa8517 3 роки тому +1

    so why do you have to do -90 at the aim angle

    • @Lps-bx7ck
      @Lps-bx7ck 2 роки тому +1

      Because if you don't, he will shoot to his right (polar angle 0). When you subtract 90 degrees, it is rotating the cube clockwise, which means the top of the cube is the shooting direction. Then it corrects to the mouse position.

    • @jmbrjmbr2397
      @jmbrjmbr2397 2 роки тому

      I don't get it too, I'm confused

  • @ashako506
    @ashako506 2 роки тому +1

    my bullet just goes to the right of the gun how do i fix this?

    • @Wittlson
      @Wittlson 2 роки тому +1

      make sure you do -90 at aimAngle

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

    How can i make the camera follow the player

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

      Theres quite a few ways but checkout my Cinemachine tutorial

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

      @@BMoDev alr thank you

  • @gusevgp1417
    @gusevgp1417 3 роки тому +1

    it says that the mousePosition doesnt exist even if I did the correct code (mousePosition = sceneCamera.ScreenToWorldPoint(Input.mousePosition);) how can I fix this/ can someone send me a copy, cuz I can't get this to work for the life of me

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

      looks like the semicolon has to be outside of both )), like (mousePosition = sceneCamera.ScreenToWorldPoint(Input.mousePosition));

    • @gusevgp1417
      @gusevgp1417 3 роки тому +1

      @@BMoDev I added a second bracket as in "hi, I'm jim (jim jones), nice to meet you."

  • @providedmoney4722
    @providedmoney4722 3 роки тому

    I try the movement but my cube just move very weird.
    Can you help me?

    • @moolayenstudios
      @moolayenstudios 3 роки тому

      Is your character only rotating toward one spot in the center of your camera?

    • @nameisian
      @nameisian 3 роки тому +1

      @@moolayenstudios yes plz help

  • @DeadeyeOutdoorman
    @DeadeyeOutdoorman 2 роки тому

    Is anyone else having issues with the OnTriggerEnter2d not triggering?

    • @BMoDev
      @BMoDev  2 роки тому

      Make sure spelling/capitalizations correct.
      Make sure IsTrigger is checked in inspector on your Collider2D component

    • @DeadeyeOutdoorman
      @DeadeyeOutdoorman 2 роки тому +1

      @@BMoDev I'm using visual studio code and simply needed to add the Unity Code Snippets Extension, thank you.

  • @GGG-hh5jo
    @GGG-hh5jo 3 роки тому

    I did all your tutorials but stuck at 6:34
    I click the Right button it won't
    Help!

  • @darshnagdeve4021
    @darshnagdeve4021 4 роки тому

    what should i do when the bullet is not moving

    • @darshnagdeve4021
      @darshnagdeve4021 4 роки тому

      what should i do if the bullet is going up

    • @maxxxxiors
      @maxxxxiors 4 роки тому

      what should i do if the bullet is falling down

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

    me thinking i was smart making the player the cameras parents so the camera follows me around only to have that fuck up the rotation

  • @umanathification
    @umanathification 4 роки тому

    Why aren't we funding this?

  • @SirJustinn
    @SirJustinn 3 роки тому

    3:49

  • @SirJustinn
    @SirJustinn 3 роки тому

    6:01

  • @SirJustinn
    @SirJustinn 2 роки тому

    7:36