Unity 2D Platformer for Complete Beginners - #4 SHOOTING

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

КОМЕНТАРІ • 894

  • @satoupendragon7329
    @satoupendragon7329 2 роки тому +187

    I just wanted to say dont forget to set the speed for the fireball in unity, you may need to select all of the fireballs you made first to change the speed for all of them. I missed that he had already set to 10 at 12:25. I was so lost as to why i couldn't shoot the fireball and after looking REALLY hard i finally realised that is was this simple. Hope this helps.

    • @fallenIights
      @fallenIights 2 роки тому +5

      Same issue

    • @k-mashup7187
      @k-mashup7187 2 роки тому +6

      Oh my god thanks
      I love you

    • @nakiaj3721
      @nakiaj3721 2 роки тому +9

      THANK YOU I was going crazy trying to figure out why I couldn't shoot

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

      See I did this and for some reason I can shoot but they don't travel across the screen. They just stay right in front of me. Goes through the whole animation, etc. Just no actual x axis movement. Any thoughts?

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

      @Kieran Ryan My first thought is that one of the methods/functions in your one of the scripts is not getting called, maybe the method has a capital letter. If not that check your other scripts and make sure everything it spelt right. Sorry if this seems patronizing, I only say to check for this as I tripped my self up doing more timnes than I want to admit.

  • @dany-c8e
    @dany-c8e 3 роки тому +69

    I just started with Unity and wanted to make my own game. Then i found this Tutorial with ALL basic knowledge for FREE! This is amazing and the tutorial still continues! Keep up the great work, LEGEND!

  • @AnEmortalKid
    @AnEmortalKid 2 роки тому +10

    For those following this in 2022 and wondering if there's an easier way to do animations, try this:
    1. Open the animation window and dock it above , such that you can see the project explorer at the same time.
    2. Search for your sprites and multi select all of them
    3. Drag the sprites into the recording timeline, they'll all be selectable and split by about a millisecond apart
    4. Drag out the animation (all keyframes selected) until they're 5m apart

  • @volterohm
    @volterohm 6 місяців тому +6

    Found this tut to help with my final course project... I've learned more in these vids than in 4 weeks of the school's unity course. Still works in 2024! 👍

    • @perrysatoshi8528
      @perrysatoshi8528 2 місяці тому +1

      It is crazy how great these tutorials are compared to fully paid courses..

    • @sephaniya4416
      @sephaniya4416 Місяць тому

      @@perrysatoshi8528 fr

  • @stevenvillarreal8970
    @stevenvillarreal8970 2 роки тому +26

    For those that seem to run into the issue where if you press the attack button the attack animation plays twice, switch GetMouseButton(0) --> GetMouseButtonDown(0) !

    • @SimbaChiep
      @SimbaChiep Рік тому +2

      Thank you! Was struggling with this late at night :)

    • @gianlucamioccoli3348
      @gianlucamioccoli3348 5 місяців тому

      Bro I was looking for mistakes for 2 days and you finally fixed it thx so much

    • @Sayada
      @Sayada Місяць тому

      I really appreciate this, I have stuck with this for 2 hours

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

    3 weeks into Unity and this is the first tutorial where I really feel like I'm learning practical stuff and not having to look up what stuff means/does and I don't have to make a bunch of my own lengthy notes.

    • @PandemoniumGameDev
      @PandemoniumGameDev  2 роки тому +2

      Very glad to hear that, good luck on the path!

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

      @@PandemoniumGameDev Pleeeaaas respond me

  • @PandemoniumGameDev
    @PandemoniumGameDev  3 роки тому +32

    Just dropped episode 5: ua-cam.com/video/jkH3fWpVor4/v-deo.html
    ● Support the channel on Patreon or UA-cam: www.patreon.com/pandemonium_games
    ua-cam.com/channels/pkMj5b5kl2_YApDvgUCVQQ.htmljoin
    ● Subscribe to the Weekly Pandemonium Newsletter: www.pandemonium-games.com/#:~:text=About%20Me-,Weekly%20Pandemonium,-Subscribe%20to%20our

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

      Hey, when i select the function for the Fireball_explode, there is no option for Deactivate()... And i get this error in the console ""error CS1061: 'Transform' does not contain a definition for 'localScaleX' and no accessible extension method 'localScaleX' accepting a first argument of type 'Transform' could be found (are you missing a using directive or an assembly reference?)""

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

      @@himbaboo1180 may be u made a mistake in code

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

      Hi I have a problem my player is not moving when I press the button but the animation is running so it looks like it is running in place. I did everything as in the video and it doesn't show me any error. If anyone can help me thank you.

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

      how to set character size bigger my scale is 5 but when i play it turns to 1 whenever i move right

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

      hey i am getting an error in the line 33 that cs0122 : 'Projectile.SetDirection(float)' is inaccessible due to its protection level can you help to solve it please

  • @Davieu101
    @Davieu101 3 роки тому +36

    DASH ABILITY:
    Hey guys if you want a DASH ability try this. Put in the PlayerMovement script. I'm kinda new to Unity but seems to work great.
    Be sure to edit the values of the newly made variables in the unity script.
    Note: Reset Dash Cooldown is what you change for faster or slower cooldowns for the dash.
    This is what I put for mine in the Unity editor:
    Dash Speed: 15
    Dash Time: 0.3
    Reset Dash Cooldown: 3
    // These variables go at the top with the others
    /* ---------------------------- */
    // how fast you want to dash
    public float dashSpeed;
    // how long you want to dash for
    public float dashTime;
    // cooldown for when dash ability is ready.
    private float dashCooldown;
    // resets the cooldown to specified time. higher numbers = longer CD
    public float resetDashCooldown;
    /* ------------------------------- */
    //in the private void Update() {... } put this in there alongside the other code
    /* ------------------------------- */
    // starts the dash cooldown timer
    dashCooldown -= Time.deltaTime;
    // stops the timer once the cooldown is ready
    if (dashCooldown < 0) {
    dashCooldown = -1;
    } else {
    dashCooldown -= Time.deltaTime;
    }
    //You can change KeyCode to whatever you like. currently on the NUMPAD 0 "zero" button
    if (Input.GetKey(KeyCode.Keypad0)) {
    if (dashCooldown

    • @cihanaltinel1014
      @cihanaltinel1014 2 роки тому +4

      With this code my game crashs and after fixing the crash it still wont work

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

      If I wanted to add a Dash Animation to this what would be the best way to do it? Like a non-looping animation that lasts as long as the dash?

    • @n.ramthilak4475
      @n.ramthilak4475 5 місяців тому

      thanks for crashing my game🥳🥳

  • @myronrudyi
    @myronrudyi 4 місяці тому +2

    Hey there! If you have the same problem as I had: In attack animation there is not working transition from attack to idle and you're still in attack after pressing it. The solution is easy, just add Exit Time to your transition (Attack -> Idle) and then set Exit Time to 0 in Settings.

  • @ukraineme96
    @ukraineme96 6 місяців тому

    I love this tutorial so much, its the first one that has shown everything that I think I need to make a decent game, and everything is so bite sized I don't feel overwhelmed.

    • @PandemoniumGameDev
      @PandemoniumGameDev  6 місяців тому

      Much appreciated, good luck on your game dev journey!

  • @random_precision_software
    @random_precision_software 3 роки тому +5

    That's a mad way of shooting m8. Using the rotate method instead of changing scale(on the player), the fireball just needs to go transform.right ...simple!
    But we all have our own way of doing things, so fair play.

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

      Yeah, it could've been easier for sure, I guess I just got stubborn. Will consider changing it in the future but for now this is it 🙂

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

      @@PandemoniumGameDev 👍

  • @samrj444
    @samrj444 2 роки тому +4

    Such great tutorials. You make Unity so easy for us! Thank you! Please upload more frequently. I learn so much from your videos and on my way to become a game developer.

  • @supermrpug2578
    @supermrpug2578 2 роки тому +2

    But still able to explain each stage in a basic manner. Honestly thanks man!

  • @maenoire2173
    @maenoire2173 3 роки тому +16

    That was a bit too quick for me, I had to pause it a million times and still I skipped setting the speed for the Fireballs and fixing the Attack in the Animator. I fixed it thanks to the comments so all good :)
    I'm really grateful for what you're doing with these videos, I feel I'm finally learning, thank you so much!!

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 роки тому +5

      Yeah there are a few things I went over too quickly, tell me if you have any issues though I'll try to help.

    • @soularpowergaming
      @soularpowergaming 3 роки тому +3

      I agree here - this was way too fast to follow along with. You've got to realize people will have this running whilst they are doing the actions, maybe trying to understand why you're doing things. First few video pace was better. With that said, thanks for making the video.

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

      @@soularpowergaming which parts were especially hard for you to follow? I'll do my best to adjust the pace

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

      Glad I wasn’t the only one that thought this lol

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

      ​@@PandemoniumGameDev plz help me With the Non Exploding Fireballs

  • @mxtrem3
    @mxtrem3 2 роки тому +4

    Another incredible tutorial, I am learning alot from your style, straight to the point and quick!

  • @marcoceron9862
    @marcoceron9862 2 роки тому +2

    This tutorial is as good as my game art course in college. Thank you so much!! As soon as I get extra money ill support your patreon ✨🙌

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

      are you happy with your education? which college is this?

  • @moritz8369
    @moritz8369 2 роки тому +12

    If someone's having trouble with the fireball not exploding on the wall it's probably because the box Collider of the wall needs to be set as trigger in the inspector under "is Trigger" :)

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

      No, the wall needs to stay a non trigger otherwise the player can just pass through. The fireballs need to be set as triggers/

    • @davidzacaj3322
      @davidzacaj3322 2 роки тому +2

      @@PandemoniumGameDev still dosent work for me

    • @Nightzo
      @Nightzo 2 роки тому +2

      My exploding animation wasn't showing up as I accidentally set the Deactivate event at time 0.00 instead of 0.25

    • @An-fb6ue
      @An-fb6ue Рік тому +2

      @@Nightzo You helped me resolved the issue. I just also somehow added an event at 0:00 for Fireball_explore animation. Remove that then the explode shows up.

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

      @@Nightzo that is what I had 😂 and ur comment made me look and WOW I had the same bug 😂 🐞

  • @RYTG
    @RYTG 2 місяці тому +1

    its fun, i keep bumping into issues and by not giving up and fixing my own mistakes, i made it trough :p guys if you bump into issues you probably typed something wrong, just check the code, if it gives you an error, look at the lines its telling you the error is on or google the error to figure out what its refering to. the next episode is mush easyer trust me.

  • @swedcast107
    @swedcast107 2 роки тому +6

    For everyone having the problem where the fireballs are colliding close to the character, try moving the firepoint up a little bit. Mine was colliding with the ground :D

  • @sdysart90
    @sdysart90 2 місяці тому +1

    4:33 "Add a box collider AND MAKE IT A TRIGGER". I missed that on the first pass. If you fail to do this, your fireball won't explode.

    • @GD_MiT
      @GD_MiT 2 місяці тому

      LIFESAVER

  • @p00ps1q
    @p00ps1q 3 роки тому +3

    You are the first one from all my subscriptions with the bell activated :D

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

    very nice reference. i am learning game dev as well and this is very helpful.
    i hope you can discuss directional / diagonal fireballs using euler angles :)

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 роки тому +3

      Hey there, much appreciated.
      We won't cover that in this series unfortunately, it's dragged on for 1 year already and I'd like to finish it quicker.

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

    finally keep it up
    btw amazing that u put information to all the complicatet things.
    And this time the video speed was also great.

  • @madara_u_chiha
    @madara_u_chiha 6 місяців тому +1

    Omg this tutorial is awesome! My dragon is spitting giant fireballs! Thanks man!

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

    TNice tutorials might just be the first motivational comnt ive ever seen on a tutorial vid. ga thanks bro

  • @Harpic1
    @Harpic1 3 роки тому +11

    Hey there, I was following the tutorial and there's something wrong with my project. At 3:48 when you go to play mode and press the mouse button, the shooting animation plays, mine doesn't.. I have reviewed the code and animator settings multiple times and cant seem to find the issue :/ maybe its something related to my mouse? If you could give any suggestions on how to solve this it'd be very appreciated! thanks
    edit: NEVERMID!! I forgot to add the attack script to the player haha

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

      thank you so much lmao. that shit had me dumbfounded

  • @soularpowergaming
    @soularpowergaming 3 роки тому +5

    Edit: I solved this. The solution was strange. I renamed the private speed variable on the Fireball script to "fireballSpeed" instead using refactor (Ctrl +R twice) and now the speed is properly being set per the serialized field. No other changes. Wondering if there is somehow global Speed variable around that is conflicting with the private variable somehow. Super weird.
    None of my other 3 scripts have a speed field.
    My fireballs are coming out facing to the right, unless I turn my character. Then the fireball flips. They also aren't moving.
    Fireball script is attached to the fireball and has the speed set to 10; it has a box collider 2d and a rigidbody 2d. The fireball spawns. I added print statements and the fireball speed is always 0.
    Fireball Update method:
    ```
    if (hit) return;
    print("Speed : " + speed);
    print("Direction : " + direction);
    float movementSpeed = speed * Time.deltaTime * direction;
    transform.Translate(movementSpeed, 0, 0);
    ```
    And SetDirection:
    ```
    public void SetDirection(float _direction)
    {
    direction = _direction;
    gameObject.SetActive(true);
    hit = false;
    boxCollider.enabled = true;
    float localScaleX = transform.localScale.x;
    if (Mathf.Sign(localScaleX) != _direction)
    localScaleX = -localScaleX;
    transform.localScale = new Vector3(localScaleX, transform.localScale.y, transform.localScale.z);
    }
    ```
    The fireball will deactivate and play the animation if it collides with anything. Unrelated bug is that if the Player walks into their own fireball, I fall through the floor.
    Interestingly the fireball logs Speed: 10, Direction: 0, so obviously movementSpeed will be 0 regardless. If I click button, I get a Direction of 1 but a Speed of 0 for that update call.

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

    This is the best series I’ve ever seen! Not only on unity, better series than all the netflix ones lol

  • @mr.noname7058
    @mr.noname7058 2 роки тому +8

    ive got a problem, in the transition between idle and attack i cant select attack as a Condition, its just not there and im not sure what i did wrong, i rewatched the video and im still not finding what i did wrong, any idea what i can do to fix it?

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

      shift and click on them (example you press shift and click idle and attack) now you can make a transition

  • @VatsalKumarB23BB104
    @VatsalKumarB23BB104 7 місяців тому +2

    my fireball is now travelling but when it hits the wall it remains stuck there and does not explode, in Unity it is shown that the animation is triggered but is not actually happening while playing the game
    btw thanks to you my previous issue was solved

  • @laur100
    @laur100 5 місяців тому

    Thanks Pandemonium, this is such a huge help. Best wishes🤩

  • @namenathan8086
    @namenathan8086 2 роки тому +4

    For anyone having trouble with the fireballs not exploding on collision, make sure that each fireball sprite is set to "is trigger" on its box collider component :)

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

      Tysm it worked

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

      i just misspelled explode that solved it for me

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

      Still having an issue with explosion that I can't sort. It never triggers the event even with the Trigger set in box collider. Weird.

    • @sampro1993
      @sampro1993 Рік тому +3

      ​ @TheMatchers A bit late to the party, but what fixed it for me is to go to the "Animation" section of my fireballs (under FireballHolder) and make sure that the "Deactivate" event is set only on the last frame of the Fireball_Explode animation. I had to removed a bunch of random "Deactivates" which I added somehow.
      Hope this helps someone! :)

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

      Thanks mate, helped me out@@sampro1993

  • @DreamForgeTeam
    @DreamForgeTeam 2 роки тому +7

    hi sir , i have a problem when i do attack shoot but fireballs can't move, note : i set speed > 0 and firePoint is the child of Player

    • @sido2373
      @sido2373 2 місяці тому

      This problem i have too, did you solve it?

    • @mertfarukgunes8733
      @mertfarukgunes8733 2 місяці тому

      @@sido2373 lol same

  • @navidabc5077
    @navidabc5077 2 роки тому +5

    i have another problem , when i shoot the fireball dont explode actually it just pass the walls and every other colliders, i tried activating is trigger in both walls and fireballs but it didnt helped

    • @g_nobon
      @g_nobon 5 місяців тому

      Did u find a solution?

  • @sterben5792
    @sterben5792 Місяць тому +3

    Okay so whenever I shoot a fireball, it goes through the wall, instead of exploding. I have set the fireballs to "IsTrigger" and my code is exactly the same as shown in the video. I have also added animation events at 0.25 for all fireballs, selecting the Deactivate() method. Please help me out cuz I've been stuck here for a couple of days now, tryna fix this error :(

    • @blackifr
      @blackifr 24 дні тому

      it's a bit late, but if you are still interested, you probably dont have a collider on your wall

    • @sterben5792
      @sterben5792 24 дні тому

      @@blackifr I checked again, and I have a collider on the wall. I'm confused.

    • @blackifr
      @blackifr 24 дні тому

      @@sterben5792 and you also have a collider on the fireball?

  • @ipsisLiperis
    @ipsisLiperis Рік тому +2

    I'm trying to fix one erro but I don't know how. My direction is always returning positive and I could't find wear in the video he put some value in it. Help me :,(

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

    Dude, you are a legend. Great explanation no BS

  • @Seals_-
    @Seals_- 2 роки тому +8

    hi Pandemonium. Everytime i shoot my fireball it stays in one place and i dont know why. i set the speed of the fireballs to 10 and my code looks the same as yours so im really confused. Can you tell me whats wrong please?

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

      I am having the same issue.

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

      Did you set all of your fireballs to 10 it you might have just said one

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

      @@loganandfun3917 I did, double checked it and all.

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

      i did to, just lift it up a few notches above the ground :)

  • @thegameplay4398
    @thegameplay4398 Рік тому +5

    I keep getting this same error: 'playermovement' does not contain a definition for 'canAttack' and no accessible extension method 'canAttack' accepting a first argument of type 'playermovement' could be found (are you missing a using directive or an assembly reference?)

    • @dookie8649
      @dookie8649 5 місяців тому

      u need to create a private void can attack() in one of the scripts

    • @EdigeSanatbek
      @EdigeSanatbek Місяць тому

      @@dookie8649 no, it's because he made it private void canattack(). You need it to be public not private to be able to access it from other files.

  • @IlianLivshitz
    @IlianLivshitz 4 місяці тому +3

    the animation from idle to attack doesn't work. can anyone help?

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

    installed according to your tutorial, synapse works fine! thanks!

  • @MusicMaker1
    @MusicMaker1 Місяць тому

    In the player attack script it is saying that Projectile isn't a unity component. these videos have so far been very helpful.

  • @d0n0x
    @d0n0x 3 роки тому +3

    for some reason the projectile collision isn't registered and the projectile does not explode...

  • @skyrri6007
    @skyrri6007 Рік тому +5

    My fireballs are always facing to the right, and I have no idea what's causing them to do so. I checked the PlayerAttack and Projectile scripts, and everything seems to be the exact same as they are in the video, do you know what might be causing this?

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

      I'm having the same problem. I've discovered that my direction is aways positive but I don't know how to solve it

    • @Beast-gx1qn
      @Beast-gx1qn 2 місяці тому

      did you find a fix for this?

    • @Beast-gx1qn
      @Beast-gx1qn 2 місяці тому

      @@ipsisLiperis did you find a fix for this?

  • @samuelmeireles9222
    @samuelmeireles9222 2 роки тому +2

    Hello my friend! How are you? I want to thank you in advance for the great videos and for the didactics too. I have a very pertinent question and I imagine many do too: How to keep the character shooting while jumping and/or moving. Thank you very much for your attention and help! I'm waiting! A hug!

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

      same prob here

    • @RealityFallen
      @RealityFallen 9 місяців тому +1

      add a connection between the jumping and walking animations in the animator

  • @livealife6473
    @livealife6473 2 роки тому +2

    i got some error when i follow ur code, can u help me tto solve this error? 'PlayerMovement' does not contain a definition for 'canAttack' and no accessible extension method 'canAttack' accepting a first argument of type 'PlayerMovement' could be found (are you missing a using directive or an assembly reference?)

  • @AgastyaMeow26
    @AgastyaMeow26 Рік тому +2

    i am able to spawn the fireball but its not moving towards the direction its at, in fact its not moving at all (animations are working just fine though). can you fix this

  • @Sympho
    @Sympho 7 місяців тому +1

    @Pandemonium do you have some tutorial for projectile shooting at mouse position? :)

  • @technicalnepaltuts
    @technicalnepaltuts 6 місяців тому

    just wanted to add that if the player keeps on pressing and there no hit for 5 seconds and since we are returning 0 from the pool as default obj, then the 0th place firecball will be re-used which should not be the case, meaning it might have hit something but it was pulled to shoot again before it was disabled/finished. Better to implement some logic if not fireball is available, either dynamically increase the pool, set the duration so that the shoot and inactive time is less so that you can re-use that fireball again or make sure your pool has enough fireballs to shoot, this is something you need to experiment if your game is supposed to have fast shooting and slow fireball disable time. Personally, I actually prefer the mix of dynamically increasing the pool by a little bit and may be set a shoot delay or timer so that you cannot spam, such as reload mechanism or something.

    • @PandemoniumGameDev
      @PandemoniumGameDev  6 місяців тому

      Totally agree and I probably should've mentioned that. But considering this is a complete beginner tutorial I think this would've been too much for most people following this.

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

    Thank you so much for making stuff in soft a lot easier to understand.

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

    Great tutorial for a newbie like me! What VS Code extensions are you using to get the autofill?

    • @PandemoniumGameDev
      @PandemoniumGameDev  2 роки тому +2

      Try this solution: ua-cam.com/video/g3sHbFmzq3I/v-deo.html&ab_channel=qubodupDev

  • @yongqin7293
    @yongqin7293 2 місяці тому +1

    hi why is my firepoint always spawning on the right even if my player is facing to the left and the fireball is going to the right direction

  • @Dlusinyants
    @Dlusinyants 2 місяці тому +1

    Hey guys. Just wanted to add a quick comment about a problem I spent a while trying to solve here. My projectile was firing very quickly and then the explosion animation was popping up way too fast and before it collided with the wall. After checking and seeing that I have a speed set on all of my fireballs and a cooldown of 0.5 on my player, I had to dig deeper to find the root cause of my issue. It turns out that when you have the box collider enabled on your fireballs, you MUST set the squares around each of them tightly (frame every fireball closely) for them to move properly and explode when collision occurs. Hope this helps someone out there.

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

    Hey, I'm having trouble getting the fireball animation up and running. I tweaked things as I went along, but after I put the 10 fireballs into the array, they just dont show up anymore. I looked for errors in the code and animations and even changed it to whats in the tutorial verbatim. Still they do not show. Any idea?

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

      Hi, I had a similar issue, and I had accidentally disabled the array holding all the fireballs, whereas you should only disable the fireballs. Hope it helps :)

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

      Hi there! Did you ever solve this?

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

    @Pandemonium I am desparate. I copied your code and implemented it to make sure I did not had any typo's. My projectile only shoots towards the right even when facing left.
    The projectile itself works perfectly fine, as well as the animations. It just doesn't shoot towards the left. What can I do?

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

    When I shoot my fireball it only travels for a very small distance and when it collides with a wall it doesn't explode

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

      Tick the isTrigger box in the Fireball Box Collider

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

      @@amitkesari2000 thanks big man

  • @dario8085
    @dario8085 2 роки тому +2

    Hi I have a problem my player is not moving when I press the button but the animation is running so it looks like it is running in place. I did everything as in the video and it doesn't show me any error. If anyone can help me thank you.

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

    Why aren't my fireballs moving forward?
    And how can I make the Fire Point we created small like you? I don't have it.

  • @issak1320
    @issak1320 Рік тому +2

    i have a problem man. My fireball doesn't change direction I don't know why. I'm facing right, and I shoot the fireball, it goes right. But if I'm facing left, and I shoot the fireball, instead of going left, it goes right.

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

      The fireballs are parented to your player object, therefore they change direction when the player does. The fireball holder has to be a separate independent object, like in the video.

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

      @@PandemoniumGameDev but in the script? or in unity? i think i have my player object separate from the fireball holder.

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

      @@issak1320 In Unity, make sure the fireball holder is not a child object of the player. It sounds like that's the problem.

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

      @@PandemoniumGameDev i think that helped! thnks!

    • @Beast-gx1qn
      @Beast-gx1qn 2 місяці тому

      did you find a fix for this?

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

    Guys I need help always if I try to shoot my 2nd fireball it just stays on the fire pointer spot
    Can you help me I also copied the code...

  • @braylongouge9103
    @braylongouge9103 2 роки тому +2

    I'm at 3:46 and it's not working. On the bottom left, it says: "Asset 'Player': Transition 'Idle -> Attack' in state 'Idle' doesn't have an Exit Time or any condition, transition will be ignored"
    It has a condition (attack) and we're not supposed to have an exit time, but I added one to see if it would help, and it still didn't. Could anyone tell me why it's saying that?

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

      If you added the attack condition it should be ok 🤔 Try recreating the transition and see if behaves the same way

  • @chingiskhan-8
    @chingiskhan-8 Рік тому +1

    Please help me! When I shoot, all animations hang, but when I shoot the second time, the animations hang

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

    FINALLY, UR A LIFE SAVER I FINALLY FOUND A REAL TUTORIAL WITH SERIES!

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

    when i shoot the fireball it stays at the firepoint it doesn't move, is there a way to fix this?

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 роки тому +9

      Select the fireball object and change the speed, your value is 0 so it doesn't move.

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

      @@PandemoniumGameDev ok thank you!

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

      @@PandemoniumGameDev hello sir got the same problem but the difference is even if I set a value on speed it still stays at the firepoint,
      edit: figured it out anyways thanks for the great video man

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

      @@viole1394 how did u do it? Because i have the same problem

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

      @@shn_9 it is just a mistake on my end. if i remember correctly itype update instead of Update or ithink it is start instead of Start. it is something around there, try to check the letter. srry cant check the code now cause im not on my pc now

  • @zappy9880
    @zappy9880 2 роки тому +2

    Hi. Great tutiorial but i am having a problem with the melee attack animation. i did exactly as said and the attack does happen when i click left click but it only happens once. I can't attack once more. Please help me. Thanks in advance!
    edit: ok nevermind i forgot the cooldownTimer += Time.deltaTime; statement lol.

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

    These are really great tutorials...I have to do every step as he does it then it works. The first script I've found that works with 2020. Thanks for the tuts Pandemonium Games I will be a subscriber.

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

      Much appreciated!

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

      Same, I tried brackeys but all of his video are *slightly outdated

  • @kawari68
    @kawari68 9 місяців тому

    First I want to thank you for your lecture, it was really great. But I'm having a problem, I've reviewed and coded your video 3 times but it still doesn't work so, when I repeatedly left click but only fireballs[0] are created. , and the second fireballs, it reports an inaccessible error because the object has been destroyed. Please help me, thank you.

  • @vladutzul1474
    @vladutzul1474 2 роки тому +2

    If your fireball dosen't move try checking animator and press apply root motion

    • @raquepocesara.8212
      @raquepocesara.8212 Рік тому

      Can you explain how to do that? what root motion?

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

      @@raquepocesara.8212 sorry man gave up a long time ago keep the good work

  • @Forceman25
    @Forceman25 5 місяців тому

    For those who are wondering why you get the Null istance error, you probably forgot to add the projectile script to all the fireballs object

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

    Thank you, It was really helpful.

  • @Hoagi
    @Hoagi 6 місяців тому +1

    Hey im sure this is a stupid mistake but at 0:58 im getting a red squiggle under private PlayerMovement says the type or namespace PlayerMovement cannot be found so then line 15 a few seconds later also gets this red squiggle

    • @Hoagi
      @Hoagi 6 місяців тому +1

      figured it out my Player Movement script said public class newbehaviorscript at the very top instead of saying PlayerMovement

    • @laur100
      @laur100 5 місяців тому +1

      @@Hoagi My man, you are a life-saver. Thank you.

    • @jazz1706
      @jazz1706 5 місяців тому +1

      Thank you i ran into the same problem

    • @markodujic6893
      @markodujic6893 5 місяців тому

      @@Hoagi on his one it say player attack not player movement though does it matter?

  • @joydrive_
    @joydrive_ 13 днів тому

    The shooting animation for my character works just fine when I left-click, but the fireball won't show up. I don't know if its an issue with the animation or if the fireball just isn't spawning at all. Can someone tell me how to resolve this issue?

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

    3.28 I can not make transition from idle to attack what should I do can you help me please?

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

    Great tutorial! I’m having a slight issue with some of the code because my computer gets mad at me whenever I try to test the game. It keeps telling “the type or namespace name of Animator could not be found” it does this for mono behavior serialize field attribute and serialize field as well. I followed the code to a T, do you know what I could be doing wrong? Thanks!

  • @cherrynoize
    @cherrynoize 6 місяців тому

    For me the issue here was setting the fireballs too close to the character. It was hard to notice since I'm using different sprites and it looked okay but the fireball kept stopping right away. I just had to resize the box collider.

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

    hey i need help!
    my player is only doing the attack animation when i jump and press mouse button what to do

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

    bro how to change the size of the character at this point?

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

    after i added "private int FindFireball" method as you show in 14:45, fireballs started to explode as soon as i fire them. When i left click repeatedly some fireballs move forward but most of them explode

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

      firePoint may be too close to player

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

    My fireballs aren't showing up and I can't figure out why. Can anyone please help me?

  • @zeynepbalakar2735
    @zeynepbalakar2735 Місяць тому

    There is no problem with my animation; it explodes and moves forward when it hits the wall. However, every time it collides with something, I get the warning: 'Fireball AnimationEvent has no function name specified!' Why do you think this happens? please help

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

    Hello bro, I want to ask.
    I want to use 2 main characters in my game for a college project assignment (sprite knight & archer). can I skip the fireball shooting part for sprite knight? and for archer, do I just change the animation part? Btw thanks for the tutorial!

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

    the right and it will soft like magic!!

  • @Maddock.
    @Maddock. Місяць тому

    After my fireball explodes it gets stuck on the last explosion animation and any fireballs I shoot after use this sprite too. How do I fix this please?

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

    For some reason when I click to shoot my fireball it doesn’t show up and when I looked at the fireball object it shows just explosion animations playing not even the idle. I did move it far from the character so it doesn’t collide with him immediately in case that’s what you think the problem is it might be an error in my code so I’ll check ur GitHub project and see if mine is the same

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

    Really nice and helpful... Thanks!

  • @iloveabg200
    @iloveabg200 2 роки тому +2

    my fireballs just get stuck in place and don't explode, and i get stuck in the animation for attacking. Any suggestions?

  • @Rooworld665
    @Rooworld665 4 місяці тому

    Hello I am getting an errror when I shoot the fireballs and is saying 'player' AnimationEvent has no function name specified

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

    Much love

  • @caesarmyths
    @caesarmyths Місяць тому

    Guys ı have 2 issue
    1.When ı start the game, after 3-5 seconds, my player is bein disappear
    2. I can't set my fireballs speed (ı've already set it 10 at unity)

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

    thanks for your great tutorial
    i actually didnt get it, what is (hit) for? can someone explain?

  • @fiker-w
    @fiker-w Рік тому

    so i have some problem. my fireball doesn't explode when it hits the wall. then i change " is trigger" on box collider of my fireball and it worked. but in your video you said set the fireball to is trigger. is it problem if i don't set it to "is trigger"

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

    man I have a problem. I copied every code but when I play it the fireball isn't moving it stays where I shoot it. So I came back to the set direction method to see if I miss something but I didn't. Hope u can help me man

    • @dario-pu7bk
      @dario-pu7bk 2 роки тому +1

      You have to change speed of fireballs

  • @geraldinathan7912
    @geraldinathan7912 2 роки тому +2

    Appreciate the video, hopefully you see this response. i have some warning in unity, i follow your video carefully but when tha character shooting fireball it is not show up. the warning : NullReferenceException: Object reference not set to an instance of an object. Any tips for fix this? I would appreciate if you help me. Thanks

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

    I have changed fireball speed. Now i can shoot but there is another problem. The first projectile is ok, but sometimes the second one stands still and does not move. I have to change the direction of movement and take a few steps to shoot again. When the fireball gets stuck I can explode it by clicking the mouse. What is wrong?

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

      I have resolved this issue. Just like that.

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

      @@maciejwietrzyk2251 how did you solve this please

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

    great video but could you please explain why you are putting private and public and what each one does

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

    More to go brother!

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

    i want to use my controller to jump and attack how would i do that

  • @allanmakay7588
    @allanmakay7588 9 місяців тому +1

    my fireballs goes through wall that has rigidbody 2d and box collider 2d, help

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

    okay so for the projectile when I use onCollisionEnter2d the function executes, but for onTriggerEnter2d, it does not execute and fireball goes in the air.
    I picked up your git project from episode 3.
    if ontriggerEnter2d works for you, why doesnt it work for me?
    Its been over 2 years since you made this video, I hope you can find the time to help me, thanks.

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

    Help me
    Why my all fireball is active at the same moment.