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.
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?
@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.
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!
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
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! 👍
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) !
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.
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
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?)""
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.
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
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
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.
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.
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.
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.
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!!
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.
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" :)
@@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.
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.
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
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 :)
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
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.
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?
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
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 :)
@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! :)
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
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 :(
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 :,(
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?
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?)
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?
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!
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?)
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
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.
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.
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.
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?
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 :)
@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?
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.
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.
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.
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 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 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
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.
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.
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.
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
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?
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!
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.
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
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
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!
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?
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
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)
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"
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
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
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?
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.
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.
Same issue
Oh my god thanks
I love you
THANK YOU I was going crazy trying to figure out why I couldn't shoot
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?
@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.
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!
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
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! 👍
It is crazy how great these tutorials are compared to fully paid courses..
@@perrysatoshi8528 fr
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) !
Thank you! Was struggling with this late at night :)
Bro I was looking for mistakes for 2 days and you finally fixed it thx so much
I really appreciate this, I have stuck with this for 2 hours
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.
Very glad to hear that, good luck on the path!
@@PandemoniumGameDev Pleeeaaas respond me
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
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?)""
@@himbaboo1180 may be u made a mistake in code
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.
how to set character size bigger my scale is 5 but when i play it turns to 1 whenever i move right
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
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
With this code my game crashs and after fixing the crash it still wont work
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?
thanks for crashing my game🥳🥳
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.
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.
Much appreciated, good luck on your game dev journey!
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.
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 🙂
@@PandemoniumGameDev 👍
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.
But still able to explain each stage in a basic manner. Honestly thanks man!
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!!
Yeah there are a few things I went over too quickly, tell me if you have any issues though I'll try to help.
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.
@@soularpowergaming which parts were especially hard for you to follow? I'll do my best to adjust the pace
Glad I wasn’t the only one that thought this lol
@@PandemoniumGameDev plz help me With the Non Exploding Fireballs
Another incredible tutorial, I am learning alot from your style, straight to the point and quick!
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 ✨🙌
are you happy with your education? which college is this?
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" :)
No, the wall needs to stay a non trigger otherwise the player can just pass through. The fireballs need to be set as triggers/
@@PandemoniumGameDev still dosent work for me
My exploding animation wasn't showing up as I accidentally set the Deactivate event at time 0.00 instead of 0.25
@@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.
@@Nightzo that is what I had 😂 and ur comment made me look and WOW I had the same bug 😂 🐞
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.
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
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.
LIFESAVER
You are the first one from all my subscriptions with the bell activated :D
Thanks man, I feel special now 😁
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 :)
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.
finally keep it up
btw amazing that u put information to all the complicatet things.
And this time the video speed was also great.
thanks man, good to hear that I'm improving
Omg this tutorial is awesome! My dragon is spitting giant fireballs! Thanks man!
TNice tutorials might just be the first motivational comnt ive ever seen on a tutorial vid. ga thanks bro
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
thank you so much lmao. that shit had me dumbfounded
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.
This is the best series I’ve ever seen! Not only on unity, better series than all the netflix ones lol
I doubt it's that entertaining 😂 but thanks a lot
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?
shift and click on them (example you press shift and click idle and attack) now you can make a transition
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
Thanks Pandemonium, this is such a huge help. Best wishes🤩
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 :)
Tysm it worked
i just misspelled explode that solved it for me
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.
@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! :)
Thanks mate, helped me out@@sampro1993
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
This problem i have too, did you solve it?
@@sido2373 lol same
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
Did u find a solution?
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 :(
it's a bit late, but if you are still interested, you probably dont have a collider on your wall
@@blackifr I checked again, and I have a collider on the wall. I'm confused.
@@sterben5792 and you also have a collider on the fireball?
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 :,(
Dude, you are a legend. Great explanation no BS
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?
I am having the same issue.
Did you set all of your fireballs to 10 it you might have just said one
@@loganandfun3917 I did, double checked it and all.
i did to, just lift it up a few notches above the ground :)
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?)
u need to create a private void can attack() in one of the scripts
@@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.
the animation from idle to attack doesn't work. can anyone help?
installed according to your tutorial, synapse works fine! thanks!
In the player attack script it is saying that Projectile isn't a unity component. these videos have so far been very helpful.
for some reason the projectile collision isn't registered and the projectile does not explode...
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?
I'm having the same problem. I've discovered that my direction is aways positive but I don't know how to solve it
did you find a fix for this?
@@ipsisLiperis did you find a fix for this?
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!
same prob here
add a connection between the jumping and walking animations in the animator
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?)
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
@Pandemonium do you have some tutorial for projectile shooting at mouse position? :)
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.
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.
Thank you so much for making stuff in soft a lot easier to understand.
Great tutorial for a newbie like me! What VS Code extensions are you using to get the autofill?
Try this solution: ua-cam.com/video/g3sHbFmzq3I/v-deo.html&ab_channel=qubodupDev
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
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.
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?
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 :)
Hi there! Did you ever solve this?
@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?
When I shoot my fireball it only travels for a very small distance and when it collides with a wall it doesn't explode
Tick the isTrigger box in the Fireball Box Collider
@@amitkesari2000 thanks big man
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.
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.
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.
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.
@@PandemoniumGameDev but in the script? or in unity? i think i have my player object separate from the fireball holder.
@@issak1320 In Unity, make sure the fireball holder is not a child object of the player. It sounds like that's the problem.
@@PandemoniumGameDev i think that helped! thnks!
did you find a fix for this?
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...
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?
If you added the attack condition it should be ok 🤔 Try recreating the transition and see if behaves the same way
Please help me! When I shoot, all animations hang, but when I shoot the second time, the animations hang
FINALLY, UR A LIFE SAVER I FINALLY FOUND A REAL TUTORIAL WITH SERIES!
when i shoot the fireball it stays at the firepoint it doesn't move, is there a way to fix this?
Select the fireball object and change the speed, your value is 0 so it doesn't move.
@@PandemoniumGameDev ok thank you!
@@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
@@viole1394 how did u do it? Because i have the same problem
@@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
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.
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.
Much appreciated!
Same, I tried brackeys but all of his video are *slightly outdated
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.
If your fireball dosen't move try checking animator and press apply root motion
Can you explain how to do that? what root motion?
@@raquepocesara.8212 sorry man gave up a long time ago keep the good work
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
Thank you, It was really helpful.
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
figured it out my Player Movement script said public class newbehaviorscript at the very top instead of saying PlayerMovement
@@Hoagi My man, you are a life-saver. Thank you.
Thank you i ran into the same problem
@@Hoagi on his one it say player attack not player movement though does it matter?
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?
3.28 I can not make transition from idle to attack what should I do can you help me please?
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!
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.
hey i need help!
my player is only doing the attack animation when i jump and press mouse button what to do
bro how to change the size of the character at this point?
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
firePoint may be too close to player
My fireballs aren't showing up and I can't figure out why. Can anyone please help me?
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
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!
the right and it will soft like magic!!
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?
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
Really nice and helpful... Thanks!
my fireballs just get stuck in place and don't explode, and i get stuck in the animation for attacking. Any suggestions?
did you find a solution? i got the same problem
Hello I am getting an errror when I shoot the fireballs and is saying 'player' AnimationEvent has no function name specified
Much love
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)
thanks for your great tutorial
i actually didnt get it, what is (hit) for? can someone explain?
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"
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
You have to change speed of fireballs
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
i have the same issue
Me too. D:
The attack part of the code isn't even being called for me.
I've been looking at that exact bug for a while now- did you ever find any fixes?
Glad I'm not alone in this
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?
I have resolved this issue. Just like that.
@@maciejwietrzyk2251 how did you solve this please
great video but could you please explain why you are putting private and public and what each one does
More to go brother!
i want to use my controller to jump and attack how would i do that
my fireballs goes through wall that has rigidbody 2d and box collider 2d, help
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.
Help me
Why my all fireball is active at the same moment.