Unity 2D Platformer for Complete Beginners - #4 SHOOTING

  Рет қаралды 162,930

Pandemonium

Pandemonium

Күн бұрын

2D platformer for complete beginners in Unity. In this episode we're adding the ability to shoot fireballs.
➤ Starting Project: github.com/nickbota/Unity-Pla...
➤ Complete Project: github.com/nickbota/Unity-Pla...
Subscribe and turn on the notifications if you don't want to miss the fourth episode!
➤ Discord : / discord
➤ Patreon: / pandemonium_g...​
➤ Instagram: / pandemonium...​
➤ Twitter: / pandemoniumnick​
➤ Itch: nickbota.itch.io/​
#pandemonium​ #unity2dplatformer​ #unitycompletebeginner​
Tags: Unity 2D Platformer for Complete Beginners,Unity 2D Platformer episode 4,Platformer for Complete Beginners,unity platformer complete beginner,unity 2d game tutorial,unity bullet,unity projectile,unity shoot,unity shooting 2d,unity platformer shooting,unity fireball,platformer shooting,platformer shooter,unity bullets,unity shooter,unity gun,unity gun 2d,unity3d tutorial,unity beginner tutorial,pandemonium games,unity 2d platformer,unity shooting
0:00​ Intro
0:10 Basic Attack
1:33​ Adding Delays
2:17 Attack Animation​
4:10​ Creating a Fireball
11:10 Object Pooling
12:24 Pooling Fireballs​
15:34​ Fixing Bugs
16:50​ Final Result & Outro

Пікірлер: 788
@satoupendragon7329
@satoupendragon7329 2 жыл бұрын
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 жыл бұрын
Same issue
@k-mashup7187
@k-mashup7187 2 жыл бұрын
Oh my god thanks I love you
@nakiaj3721
@nakiaj3721 2 жыл бұрын
THANK YOU I was going crazy trying to figure out why I couldn't shoot
@kieranryan7625
@kieranryan7625 Жыл бұрын
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 Жыл бұрын
@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.
@user-bx6th4bs8x
@user-bx6th4bs8x 2 жыл бұрын
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!
@samrj444
@samrj444 2 жыл бұрын
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.
@mxtrem3
@mxtrem3 2 жыл бұрын
Another incredible tutorial, I am learning alot from your style, straight to the point and quick!
@Sultoneq
@Sultoneq 3 жыл бұрын
finally keep it up btw amazing that u put information to all the complicatet things. And this time the video speed was also great.
@PandemoniumGameDev
@PandemoniumGameDev 3 жыл бұрын
thanks man, good to hear that I'm improving
@marcoceron9862
@marcoceron9862 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 Жыл бұрын
are you happy with your education? which college is this?
@yugbhagat6531
@yugbhagat6531 3 жыл бұрын
More to go brother!
@pianoatthirty
@pianoatthirty Жыл бұрын
I have to say these tutorials are SO SEXY. Not only is your teaching style super clear, but you also teach good practices - object pooling? Man, I've done so many tutorials that just used instantiate and destroy. So interesting to learn something more efficient. THANK YOU. Really enjoying this series.
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
Thanks a lot! I've used instantiate destroy a lot before but it can really kill your game if you play longer sessions.
@guilhermekaercher1624
@guilhermekaercher1624 11 ай бұрын
Dude, you are a legend. Great explanation no BS
@AnEmortalKid
@AnEmortalKid Жыл бұрын
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
@viacheslavzyrianov
@viacheslavzyrianov 3 жыл бұрын
You are the first one from all my subscriptions with the bell activated :D
@PandemoniumGameDev
@PandemoniumGameDev 3 жыл бұрын
Thanks man, I feel special now 😁
@ignaciomontiel1369
@ignaciomontiel1369 Жыл бұрын
installed according to your tutorial, synapse works fine! thanks!
@daniyaldk946
@daniyaldk946 Жыл бұрын
TNice tutorials might just be the first motivational comnt ive ever seen on a tutorial vid. ga thanks bro
@supermrpug2578
@supermrpug2578 Жыл бұрын
But still able to explain each stage in a basic manner. Honestly thanks man!
@mauriciocol5075
@mauriciocol5075 6 күн бұрын
Omg this tutorial is awesome! My dragon is spitting giant fireballs! Thanks man!
@chilukproducoes
@chilukproducoes Жыл бұрын
Thank you so much for making stuff in soft a lot easier to understand.
@hellblazer8543
@hellblazer8543 2 жыл бұрын
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 жыл бұрын
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.
@kareemmongy9333
@kareemmongy9333 Жыл бұрын
Thank you, It was really helpful.
@stevenvillarreal8970
@stevenvillarreal8970 Жыл бұрын
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 Жыл бұрын
Thank you! Was struggling with this late at night :)
@swedcast107
@swedcast107 2 жыл бұрын
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
@random_precision_software
@random_precision_software 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@PandemoniumGameDev 👍
@JohnSebesta7
@JohnSebesta7 2 жыл бұрын
Great tutorial for a newbie like me! What VS Code extensions are you using to get the autofill?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Try this solution: kzbin.info/www/bejne/nWTWeZV8ot-kaas&ab_channel=qubodupDev
@ahmadgymnaster4031
@ahmadgymnaster4031 Жыл бұрын
Really nice and helpful... Thanks!
@EagleNestGames
@EagleNestGames Жыл бұрын
Great tutorial...thanks a lot!!!!!
@jacksnintendoshorts
@jacksnintendoshorts Жыл бұрын
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!
@thegameplay4398
@thegameplay4398 Жыл бұрын
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?)
@Davieu101
@Davieu101 2 жыл бұрын
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 жыл бұрын
With this code my game crashs and after fixing the crash it still wont work
@tonyaldrich1564
@tonyaldrich1564 11 ай бұрын
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?
@arkanzahrawaani1594
@arkanzahrawaani1594 6 ай бұрын
where did u use the function Deactivate?
@hush2956
@hush2956 6 ай бұрын
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!
@mr.noname7058
@mr.noname7058 2 жыл бұрын
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
@LRXM4N
@LRXM4N 7 ай бұрын
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.
@Sympho
@Sympho 26 күн бұрын
@Pandemonium do you have some tutorial for projectile shooting at mouse position? :)
@nathalieganesh6609
@nathalieganesh6609 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
@ipsisLiperis
@ipsisLiperis Жыл бұрын
Did you solved it?
@GRproductionEnt
@GRproductionEnt 2 жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
Hi there! Did you ever solve this?
@visserjonck5584
@visserjonck5584 Жыл бұрын
thank u helped me a lot
@stevejojomon5664
@stevejojomon5664 2 жыл бұрын
Hi your videos are very good, been following the past videos however in this one I got a bit stuck on the shooting section. When I shoot the fireball stops at the fire point and explodes when I go near the fireball, any tips on how to fix this. No worries it’s fixed now, I just had to change the speed of the fireball:)
@lians1553
@lians1553 4 ай бұрын
thank you i have same problem
@navidabc5077
@navidabc5077 Жыл бұрын
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
@ayoobalaamuneam6235
@ayoobalaamuneam6235 Жыл бұрын
Coooooooool! Working stable
@Harpic1
@Harpic1 2 жыл бұрын
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
@Trikazor360
@Trikazor360 Жыл бұрын
thank you so much lmao. that shit had me dumbfounded
@smoothdawg1433
@smoothdawg1433 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.
@devgameidea9658
@devgameidea9658 Жыл бұрын
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
@moritz8369
@moritz8369 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@PandemoniumGameDev still dosent work for me
@Nightzo
@Nightzo Жыл бұрын
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 Жыл бұрын
@@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 😂 🐞
@soularpowergaming
@soularpowergaming 2 жыл бұрын
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.
@Emperos
@Emperos Жыл бұрын
@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?
@kekeke7815
@kekeke7815 Жыл бұрын
Much love
@Tizzer169
@Tizzer169 Жыл бұрын
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 Жыл бұрын
Very glad to hear that, good luck on the path!
@intrusos4335
@intrusos4335 Жыл бұрын
@@PandemoniumGameDev Pleeeaaas respond me
@DeoTheDoge
@DeoTheDoge 2 жыл бұрын
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
@maenoire2173
@maenoire2173 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@soularpowergaming which parts were especially hard for you to follow? I'll do my best to adjust the pace
@blaketheshepherd
@blaketheshepherd 2 жыл бұрын
Glad I wasn’t the only one that thought this lol
@lyricaldemon2537
@lyricaldemon2537 10 ай бұрын
​@@PandemoniumGameDev plz help me With the Non Exploding Fireballs
@namenathan8086
@namenathan8086 Жыл бұрын
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 Жыл бұрын
Tysm it worked
@reggiechef911
@reggiechef911 Жыл бұрын
i just misspelled explode that solved it for me
@TheMatchers
@TheMatchers Жыл бұрын
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 11 ай бұрын
​ @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 7 ай бұрын
Thanks mate, helped me out@@sampro1993
@gamehubentertainment9549
@gamehubentertainment9549 Жыл бұрын
Want to thank you for the Tutorials are really great. I have done everything you did code and components. I am having an issue where after lets say 20 sec in game or after firing several projectiles, then my projectiles disappear almost immediately after pressing the fire Button. If i sit next to a Collider i will see the explode animation but i have to sit exactly next to it. It seems like that after the projectile gets active , it gets inactive, and after than none of the other projectiles work. Thank you in advance.
@TheUltraTeam
@TheUltraTeam Жыл бұрын
In the SetDirection method make sure to have a lifetime = 0; line. I did that and my problem was instantly fixed. Hope this helps :)
@ondrejpolicky9957
@ondrejpolicky9957 2 жыл бұрын
Hey, just started the video, can i do shooting even when i did not do the walls? Because i saw some code from the jump on wall video and i don't want to use this, is it possibel even without it? Thank you bro for you amazing tutorials
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
You can definitely still do the shooting but you might get confused by the differences in code. You can just copy the project from episode 3 from GitHub if you don't wanna implement that yourself.
@TheCrabActivist4525
@TheCrabActivist4525 2 жыл бұрын
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 2 жыл бұрын
Might be the fact that the animation transitions to Explode right away. Check if you have a trigger on the Idle -> Explode animation.
@insane6782
@insane6782 3 жыл бұрын
thank u man
@maksedits933
@maksedits933 2 жыл бұрын
This is the best series I’ve ever seen! Not only on unity, better series than all the netflix ones lol
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
I doubt it's that entertaining 😂 but thanks a lot
@livealife6473
@livealife6473 Жыл бұрын
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?)
@jayjohnson4143
@jayjohnson4143 Жыл бұрын
I'm having this issue where it seems my idle animation has become my attack animation, like when I don't press anything my character is constantly firing and only sometimes the projectile comes out.
@skyrri6007
@skyrri6007 Жыл бұрын
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 Жыл бұрын
I'm having the same problem. I've discovered that my direction is aways positive but I don't know how to solve it
@darshansharma6666
@darshansharma6666 Жыл бұрын
hey i need help! my player is only doing the attack animation when i jump and press mouse button what to do
@Geckotr
@Geckotr 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
@jamesfisher4870
@jamesfisher4870 2 жыл бұрын
firePoint may be too close to player
@Mc64REAL
@Mc64REAL 9 ай бұрын
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?
@kobxlaser9221
@kobxlaser9221 25 күн бұрын
yo a quick question how to change the keys used to go right and left in the "PlayerMovement" script
@ChadEricCartman
@ChadEricCartman 10 ай бұрын
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.
@nizarakibi3683
@nizarakibi3683 7 ай бұрын
it didnt work for me projectile already exist in in level without pressing any input and when i pressed old projectile disappear and new one shows (they are not even moving or having a hitbox my character can pass through them)
@rickbrumbeloe1
@rickbrumbeloe1 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 2 жыл бұрын
Much appreciated!
@quotes612
@quotes612 2 жыл бұрын
Same, I tried brackeys but all of his video are *slightly outdated
@niamatakbari8329
@niamatakbari8329 2 жыл бұрын
Hi I have a problem with Player Attack script. when I press fIre button is show me an error (NullReferenceException: Object reference not set to an instance of an object PlayerAttack.Update () (at Assets/Scripts/PlayerAttack.cs:26), can you sai what I have to do with this.
@zappy9880
@zappy9880 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.
@-Cliffe
@-Cliffe Жыл бұрын
I have problems with the fireballs. 1. When I shoot some of them it goes up. 2. When I fire them at the walls some of them doesn't explode and slides through the top.
@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.
@StigDesign
@StigDesign 3 жыл бұрын
Love it :D
@PandemoniumGameDev
@PandemoniumGameDev 3 жыл бұрын
And I love your support 😁 thanks a lot
@StigDesign
@StigDesign 3 жыл бұрын
@@PandemoniumGameDev hehe :D i try my best :D
@yugbhagat6531
@yugbhagat6531 3 жыл бұрын
YESSS!!!!!!
@AgastyaMeow26
@AgastyaMeow26 Жыл бұрын
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
@Seals_-
@Seals_- Жыл бұрын
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 11 ай бұрын
i did to, just lift it up a few notches above the ground :)
@samuelmeireles9222
@samuelmeireles9222 Жыл бұрын
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 3 ай бұрын
add a connection between the jumping and walking animations in the animator
@fiker-w
@fiker-w 11 ай бұрын
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"
@hfucc0324
@hfucc0324 2 жыл бұрын
Hello, when i completed the amination of attack and i click the mouse my character do a "double" attack animation but if i change transition to any state it works normally. I don't know why :Đ can you explain it for me? Btw thank you for this awesome video
@Eachontv
@Eachontv 2 жыл бұрын
Click on player and under the Attack script, change Attack Cooldown to 0.5 or higher. If it's 0, it played very fast and does a double animation.
@Skullforlife
@Skullforlife Жыл бұрын
FINALLY, UR A LIFE SAVER I FINALLY FOUND A REAL TUTORIAL WITH SERIES!
@navidabc5077
@navidabc5077 Жыл бұрын
thanks for your great tutorial i actually didnt get it, what is (hit) for? can someone explain?
@verygoodchannel1058
@verygoodchannel1058 2 жыл бұрын
great video but could you please explain why you are putting private and public and what each one does
@reapindemon
@reapindemon 2 жыл бұрын
Hey you have been the biggest help in my way to code but. . . I kinda ran into an problem at like the end of the video. When I shoot it dissapears after 5 seconds like it does in the video, but when the first one dissapears after 5 seconds. I will be unable to fire the other fireballs. It just doesn't activate it just stays off. I have no errors according to unity but it doesn't realy work correctly like it does in the video. It is getting frustrating cus I couldn't find anything on what is the problem.
@reapindemon
@reapindemon 2 жыл бұрын
Found it! put the lifetime in the OnTrigger2DEnter method instead of the SetDirection method. I guess I should have slowed the video down a tiny bit.
@MiyamotoMusashi209
@MiyamotoMusashi209 Жыл бұрын
my fireballs just get stuck in place and don't explode, and i get stuck in the animation for attacking. Any suggestions?
@Skuid69
@Skuid69 Жыл бұрын
Hey, I am just starting unity, and im following this tutorial, but the sprites are modified. How would I make the character wing a sword?
@robbylemmens9734
@robbylemmens9734 2 жыл бұрын
Silly question, when I shoot a fireball, the animation works like a charm. When I shoot my second fireball, it will just sit there and not move. It seems only when there are no "active" fireballs, that the movement seems to work. Obviously I did something wrong, but after comparing the code, I can"t see/spot the difference. I can just copy the full project but I'm trying to understand what is happening here.
@robbylemmens9734
@robbylemmens9734 2 жыл бұрын
Nevermind, I recreated the fireballs in the array, that seems to have solved the problem... Very strange... Thanks again for the awesome tutorials!
@PandemoniumGameDev
@PandemoniumGameDev 3 жыл бұрын
Just dropped episode 5: kzbin.info/www/bejne/oJyrZJmNpbuiqJY
@himbaboo1180
@himbaboo1180 2 жыл бұрын
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___ 2 жыл бұрын
@@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 Жыл бұрын
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
@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?
@haduong68
@haduong68 2 ай бұрын
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.
@eryslaw5098
@eryslaw5098 3 жыл бұрын
Great tutorial man... thought about making a discord ? I see people always asking for help in the comments, maybe a server would make this easier
@PandemoniumGameDev
@PandemoniumGameDev 3 жыл бұрын
we do have a server, people are asking questions there as well. Check out the description link
@eryslaw5098
@eryslaw5098 3 жыл бұрын
It just takes me to discords official page or the app... doesn't invite me to the actual server :/
@PandemoniumGameDev
@PandemoniumGameDev 3 жыл бұрын
@@eryslaw5098 discord.gg/bqwHPVq4KY
@eryslaw5098
@eryslaw5098 3 жыл бұрын
@@PandemoniumGameDev cheers, got it
@marekpuchon4878
@marekpuchon4878 2 жыл бұрын
Those are super perfect tutorilas thank you!!! I have one question. When i shoot and then again the first bullet is destroyed. Any idea why? I copied your script so there is no error there.
@Ethan_Myles
@Ethan_Myles Жыл бұрын
Hi, I'm having a similar issue at the moment, did you figure out why this is happening ? Thanks.
@Ethan_Myles
@Ethan_Myles Жыл бұрын
Solved, had to change the size of the box colliders on the bullets.
@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.
@benjaminborja5029
@benjaminborja5029 Жыл бұрын
How did you wake up objects on the pool? I know that I can do it with .SetActive on true, but just thinking, kind of weird that I didn't see any similar on the code and it works anyway
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
We actually did use SetActive(true) in the projectile script in the SetDirection method.
@benjaminborja5029
@benjaminborja5029 Жыл бұрын
Lmao didn't notice it, thank you
@noah6242
@noah6242 2 жыл бұрын
I am having an issue where I get to the end of the video and no fireballs are producing when I click? Not too sure what to do
@jexalegitimas8555
@jexalegitimas8555 Жыл бұрын
the right and it will soft like magic!!
@duyha2454
@duyha2454 10 ай бұрын
thank you
@Ruby-4
@Ruby-4 10 ай бұрын
Please help me! When I shoot, all animations hang, but when I shoot the second time, the animations hang
@TheZooMC
@TheZooMC 2 жыл бұрын
This tutorial has been the best help ive has with this thank you so much. Im having a problem with my fireballs. when i click, a fireball appears but doesnt move. but when I walk into it. it gets pushed and moves but it doesnt explode on impact. it just stays there.
@bedizzy2373
@bedizzy2373 2 жыл бұрын
Same problem here
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
First make sure to set the speed of the fireball to something higher than 0, second change the collider on the fireball to IsTrigger
@Vide0GamePr0
@Vide0GamePr0 2 жыл бұрын
@@PandemoniumGameDev hi i did this but i still face the same problem as stated above. the fired projectile does not move
@Vide0GamePr0
@Vide0GamePr0 2 жыл бұрын
@@PandemoniumGameDev nevermind i found out why, it was a problem with my sprite!
@mikeduris740
@mikeduris740 Жыл бұрын
@@Vide0GamePr0 What was the problem with the sprite if you remember? I'm currently having the issue of a stationary fireball that does everything else as it should but move even with a speed set and x axis unlocked
@mirlikiiski9054
@mirlikiiski9054 Жыл бұрын
Thank you for the video!) There was a question how to make an air attack?
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
You could remove the isGrounded() condition from the canAttack method (0:37). That would allow an air attack but I'm not sure how this would work with our current animations.
@mirlikiiski9054
@mirlikiiski9054 Жыл бұрын
@@PandemoniumGameDev That's what I did, but it still doesn't help. I made a new trigger in the attack-flying animator and registered in the method if the hero is in the air, activate the attack flight But the animation doesn't work.
@mirlikiiski9054
@mirlikiiski9054 Жыл бұрын
Hello again!) I was able to fix it. It turned out that I coded everything correctly. It was necessary to change the animation transitions. Namely, remove the jump transition from any state. In any case, once again I want to say a BIG THANK YOU for your course, everything is clear and without superfluous. And from such personal Wishlist, I would like a lesson about parries and counterattacks for 2d games, since I could not find information on this topic anywhere.
@h1_355
@h1_355 Жыл бұрын
You are lucky my favourite nice tuto is nice tuto
@ananymousgaming1007
@ananymousgaming1007 Жыл бұрын
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?
@reginaldsavage341
@reginaldsavage341 Жыл бұрын
when i shoot it does not go straight, it curls in different directions. Edit: i had to freeze the Z position. but now when i shoot for the first time it goes forward with no animation but after every time i shoot it stays in the explosion animation until it collides with something then it goes back Edit: the animation broke it.(i am not using the same sprites as shown in the video)
@jedininjas8609
@jedininjas8609 2 жыл бұрын
This is so amazing and clear. but i am having one problem that I'm hoping you can help me out with. so my fireball, when i shoot it, kind of just stays there and does not move and then when I run into it it explodes. could you help me out?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Sounds like the speed of the fireballs is 0. Select all of them and set the speed to something bigger than 0
@zeynepgul551
@zeynepgul551 2 жыл бұрын
@@PandemoniumGameDev That helped so much. Thank you for amazing tutorials ^^
@lov3ly298
@lov3ly298 2 жыл бұрын
@@PandemoniumGameDev thanks for this answer. It helped my dummy head a lot
@krilldots9523
@krilldots9523 2 жыл бұрын
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
@ninjaheroes6263
@ninjaheroes6263 2 жыл бұрын
me too
@jayaprasanthsingh1775
@jayaprasanthsingh1775 2 жыл бұрын
@@ninjaheroes6263 u have to change the speed in all the fireballs manually
Unity 2D Platformer for Complete Beginners - #5 GRAPHICS
9:34
Pandemonium
Рет қаралды 83 М.
Unity 2D Platformer for Complete Beginners - #3 WALL JUMPING
17:16
Pandemonium
Рет қаралды 162 М.
I Tried Breaking an Unbreakable Wine Glass
00:59
Stokes Twins
Рет қаралды 76 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 36 #shorts
00:27
Osman Kalyoncu
Рет қаралды 66 МЛН
A cool gadget for moms to use to spoon-feed their babies💕
00:21
КАРМАНЧИК |2 СЕЗОН 2 СЕРИЯ
25:40
Inter Production
Рет қаралды 712 М.
MELEE COMBAT in Unity
21:07
Brackeys
Рет қаралды 1,6 МЛН
How much MONEY my Game made (and how much it cost!)
14:00
Code Monkey
Рет қаралды 143 М.
Unity: 2D Shooting
4:17
Root Games
Рет қаралды 43 М.
Unity 2D Platformer for Complete Beginners - #7 HEALTH SYSTEM
23:17
Can you beat Bad Piggies WITHOUT Electricity?!
24:13
Drengodr
Рет қаралды 88 М.
Improve Your Platformer with Forces | Examples in Unity
7:01
Dawnosaur
Рет қаралды 158 М.
Unity 2D Platformer for Complete Beginners - #1 PLAYER MOVEMENT
15:38
Escaping Unity Animator HELL
18:18
Lost Relic Games
Рет қаралды 486 М.
Give him BACK!!! ft GH.S | Poppy Playtime Chapter 3
0:16
keitaro3660
Рет қаралды 8 МЛН
Gegagedigedagedago vs freddy fazbear
0:29
FlentShow
Рет қаралды 40 МЛН
#brawlstars #brawlstarsmeme #boxopening
0:21
OMG TOP
Рет қаралды 7 МЛН
УСПЕЮ ЛИ Я СПАСТИ СОБАКУ 🐶
0:49
Космо
Рет қаралды 2,3 МЛН
Афмау, Не используй это ЗЕЛЬЕ!
0:45
Просто Люка
Рет қаралды 2 МЛН