Unity 2D Platformer for Complete Beginners - #4 SHOOTING

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

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

  • @satoupendragon7329
    @satoupendragon7329 2 года назад +185

    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!

  • @PandemoniumGameDev
    @PandemoniumGameDev  3 года назад +32

    Just dropped episode 5: ruclips.net/video/jkH3fWpVor4/видео.html
    ● Support the channel on Patreon or RUclips: www.patreon.com/pandemonium_games
    ruclips.net/channel/UCpkMj5b5kl2_YApDvgUCVQQjoin
    ● 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

  • @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 Месяц назад +1

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

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

      @@perrysatoshi8528 fr

  • @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

  • @stevenvillarreal8970
    @stevenvillarreal8970 Год назад +25

    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

  • @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🥳🥳

  • @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

  • @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.

  • @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 :)

  • @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

  • @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?)

  • @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.

  • @p00ps1q
    @p00ps1q 3 года назад +3

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

  • @Harpic1
    @Harpic1 2 года назад +10

    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

  • @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?

  • @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 😂 🐞

  • @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!

  • @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.

  • @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 👍

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

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

  • @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

  • @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?

  • @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 Месяц назад

      @@sido2373 lol same

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

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

  • @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?

  • @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

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

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

  • @hellblazer8543
    @hellblazer8543 2 года назад +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  2 года назад +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.

  • @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 :,(

  • @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

  • @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?

  • @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

  • @IlianLivshitz
    @IlianLivshitz 4 месяца назад +3

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

  • @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 11 дней назад

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

    • @sterben5792
      @sterben5792 11 дней назад

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

    • @blackifr
      @blackifr 11 дней назад

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

  • @zeynepbalakar2735
    @zeynepbalakar2735 28 дней назад

    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

  • @puertoroc4035
    @puertoroc4035 3 года назад +10

    Hey so after entering code to shoot multiple times, after I take my first shoot the second stays at firing point, any fix?
    Figured it out had to change projectile speed on each fireball, but now my fireballs do not explode on impact

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 года назад +1

      Make sure the collider is a trigger

    • @joseph-kl1xf
      @joseph-kl1xf 3 года назад +1

      @@PandemoniumGameDev i have the same problem and my collider is trigger and idk why it doesnt work

    • @val81leal
      @val81leal 3 года назад

      @Pandemonium Games same problem here

    • @SuperGonzales94
      @SuperGonzales94 3 года назад +9

      Make sure you enter a Speed for all you balls in the inspectors window under Projectile script component. Also make sure all the balls have gravity Scale set to zero, any other value will make the balls fall down and not follow a straight trajectory.

    • @dArijit
      @dArijit 3 года назад +1

      whoever is having this problem, try changing your attack cooldown value in inspector

  • @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.

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

    @Pandemonium Hey so a recent problem came up with me. I'm on number 10 but I noticed that my fireballs will not shoot towards the left when I am facing the left. when i shoot, the animation shows that they still shoot right and they will hit me. I have the exact same code as you in the projectile and the player attack script. Is there something that i've done with the scaling or the position that might be wrong in the editor?

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

      and for some reason I'm not dealing damage to the enemies either. a bunch of weird stuff that has just come up.

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

      @@smoothdawg1433 I'm having the same issue. Did you ever find a fix for this? I put a "Debug.Log(transform.localScale.x);" on the Attack method and I'm noticing that the localScale.x is always returning as 1 no matter which way I'm facing and I can't wrap my brain around why that is. I'm guessing this is why the Fireball keeps moving to the right regardless which way I'm facing. If I understand the lesson correctly, when facing to the left, that value should return as -1 not 1.

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

    I’m not sure will you see this but i’m having an issue. I have set up the attack animation like here 3:52, but i can’t move my character. I have the right script, and everything is supposed to be right. Like when i move to left it knows i’m running but i can’t move. And when i click it’s attacking i haven’t set any fireballs yet. Could you help me?

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

    my script doesnt regonize "horizontalInput" and idk whats wrong with it

  • @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.

  • @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

  • @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

  • @Hoagi
    @Hoagi 5 месяцев назад +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 5 месяцев назад +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?

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

    it keeps saying 'Player' AnimationEvent has no function name specified! help me if you can

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

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

  • @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

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

    Please help, for some reason i got a CS1061 error. Assets\Scripts\PlayerAttack.cs(22,89): error CS1061: '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?) how do I fix this?

  • @The.Monke5276
    @The.Monke5276 2 года назад +2

    Can you please help me? When i shoot the fireball, it travels fine but when it hits a wall, it just disappears instead of exploding. Also, everytime i click, i get the "NullReferenceException: Object reference not set to an instance of an object" error

    • @1wntv
      @1wntv Год назад

      did you find out how to fix it, I got that error too after changing the lifetime value around

    • @The.Monke5276
      @The.Monke5276 Год назад

      @@1wntv its so long ago that i dont remember, but i think that i either found a solution on stack overflow, or i gave up on the project altogether

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

      @@1wntv You probably forgot to add the projectile script to all the fireballs object

  • @yongqin7293
    @yongqin7293 Месяц назад +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

  • @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.

  • @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

  • @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?

  • @Riumi.
    @Riumi. 21 день назад

    'Fireball' AnimationEvent has no function name specified!
    Help please

  • @Maddock.
    @Maddock. 17 дней назад

    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?

  • @chingiskhan-8
    @chingiskhan-8 Год назад +1

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

  • @TheCrabActivist4525
    @TheCrabActivist4525 3 года назад +1

    Howdy, how are you doing? I've got an issue that I was wondering if you could help me with. When I fire it goes in the correct direction however, it immediately explodes. My first thought was that it collided with my model but that doesn't seem to be the issue, any thoughts? (Sorry if this is a dumb question I'm semi new to this sort of thing)

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 года назад

      Might be the fact that the animation transitions to Explode right away. Check if you have a trigger on the Idle -> Explode animation.

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

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

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

    hey, I have this issue where when I shoot the projectile, it instatnly transitions into the explosion. there are no colliders infron it just doesn't move and stops exactly at the firepoint

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

    Im pretty behind but when i shoot my fireballs they come out perfect but my character gets stuck in its animation ive tried playing around with the attack animator and nothings helped does anyone know what could be the issue here? maybe its something with the code? I know idle>attack has no exit time and attack>idle does which is how i have it but its the same result it gets stuck in animation. Please help Thank you!

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

    my explode animation wont play and the on trigger enter 2d is on yellow color not blue i cant get it to turn blue

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

    Hi! Thank you for great Tutorials! I just have one error I keep receiving for this code in the Projectile Script "if(Mathf.Sign(localScaleX) != _direction). It tells me that the floating points can be unequal due to the differing precision of the 2 values. Do you know why this is? I've been following step by step but can't seem to solve it

  • @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!

  • @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.

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

    Hello, i have a slight issue when i fire my fire ball it just teleports in front of me a set distance and doesn't travel there any idea how to fix ty.

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

    Dude, you are a legend. Great explanation no BS

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

    question: i am stuck on animation for some reason. when i right click idle transition window doesn't pop up does anybody knows how to make transition thingy pop up when i click idle?

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

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

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

    can someone help me i keep getting this: error CS0122: 'Projectile.SetDirection(float)' is inaccessible due to its protection level

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

    Hey I have an issue where when I start my game and shoot my fireball, the first one flies in a line like its supposed to but after it explodes and I go to shoot another fireball, that one will just stay still in front of my character. Don't know what I'm doing wrong

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

    Hey please Help!,
    i was editing some bits through this video while it was still in play mode, i eventually tried to test the attack but im not sure its even registering my click? nothing happens when i attack what did i miss?

  • @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?

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

      make sure that the fireball holder is not a child of the player and is separate

  • @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

  • @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.

  • @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!

  • @MusicMaker1
    @MusicMaker1 28 дней назад

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

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

    Hi @PandemoniumGameDev can you help me please? I have to push mouse button twice for the animation to work?

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

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

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

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

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

    Hey plz help me!! I was in middle of video and when i was writing code in PlayerAttack script it shoes an error for projectile.SetDirection
    It says
    'Projectile.SetDirection(float)' is inaccessible due to its protection level
    Plz help if u can

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

      can you help me with it please if it is solved by you

  • @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

  • @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"

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

    yo a quick question how to change the keys used to go right and left in the "PlayerMovement" script

  • @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?

  • @ytthor4796
    @ytthor4796 3 года назад +1

    hey i am not getting the fireball animator is showing old animator of play how i csn make new animator for fireball plzzz reply

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 года назад

      Select the fireball object, add an animator component to it, create a new animator and assign it to it. Then when you go to the animator window you should see the new one

    • @ytthor4796
      @ytthor4796 3 года назад

      @@PandemoniumGameDev i have but is not showing

  • @lukablacking7754
    @lukablacking7754 3 года назад

    i have this how can i fix it? :( Assets\Scripts\Projectile.cs(32,9): error CS0103: The name 'game0bject' does not exist in the current context

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 года назад

      You spelled it game0bject, should be gameObject. Make sure to enable autocomplete to avoid these kind of mistakes: ruclips.net/video/g3sHbFmzq3I/видео.html&ab_channel=qubodupDev

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

    My fire balls just stay in one place and i get the error "object refrence not set to an instance of an object" how do i fix this?

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

    I get an error stating that:
    "'Fireball' AnimationEvent 'Deactivate()' on animation 'Fireball_explode' has no receiver! Are you missing a component?"
    How do I fix this?

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

      Sounds like one or more of your fireballs don't have the projectile script attached.

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

      @@PandemoniumGameDev Thank you!

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

    Hello , i have done till here . but my fireballs arent exploding . i have done the code from your github too. it works smoothely , but the fireballs arent exploding
    . please help .

  • @d0n0x
    @d0n0x 3 года назад +3

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

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

    @PandemoniumGameDev I'm having an issue with my fireballs when I shoot it only uses fireballs (1-3) and leaves the rest unused. Also after firing multiple times the game crashes. Does someon know how to fix this?

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

      i have this problem too, mine only uses fireballs one. did u get the answer to fix that?

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

    Help pls. My fireball, when hitting nothing, just explodes out of random without touching anything. What can I do to fix it?

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

    hello, i’m having an issue where whenevr i fire the fireball, it appears but doesn’t move, and it explodes when my player touches it, any ideas?

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

      Hey I had the same problem have u adjust the speed on your fireballs mine was on 0 I tweaked them to 10 and it worked fine maybe it will work for u 😁

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

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

  • @VatsalKumarB23BB104
    @VatsalKumarB23BB104 6 месяцев назад +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

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

    Hi bro, I have a error in Unity,
    It shows " error CS0122: 'Projectile.SetDirection(float)' is inaccessible due to its protection level"
    Please help me to fix this error.
    And also in Unity,
    In Player attack script ,the Fire Point option not showing.

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

    my character isn't shooting, and for some reason the jumping sort of deactivates itself.
    What can I do?