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!
Just dropped episode 5: ruclips.net/video/jkH3fWpVor4/видео.html ● Support the channel on Patreon or RUclips: www.patreon.com/pandemonium_games ruclips.net/channel/UCpkMj5b5kl2_YApDvgUCVQQjoin ● Subscribe to the Weekly Pandemonium Newsletter: www.pandemonium-games.com/#:~:text=About%20Me-,Weekly%20Pandemonium,-Subscribe%20to%20our
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
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 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
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.
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
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?
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?)
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?
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.
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?)
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.
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
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?
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.
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.
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'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.
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
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 :)
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
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 :)
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 :,(
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 :(
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
Hey so after entering code to shoot multiple times, after I take my first shoot the second stays at firing point, any fix? Figured it out had to change projectile speed on each fireball, but now my fireballs do not explode on impact
Make sure you enter a Speed for all you balls in the inspectors window under Projectile script component. Also make sure all the balls have gravity Scale set to zero, any other value will make the balls fall down and not follow a straight trajectory.
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.
@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 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.
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?
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'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?
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
@@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
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?
Can you please help me? When i shoot the fireball, it travels fine but when it hits a wall, it just disappears instead of exploding. Also, everytime i click, i get the "NullReferenceException: Object reference not set to an instance of an object" error
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.
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?
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)
hey, I have this issue where when I shoot the projectile, it instatnly transitions into the explosion. there are no colliders infron it just doesn't move and stops exactly at the firepoint
Im pretty behind but when i shoot my fireballs they come out perfect but my character gets stuck in its animation ive tried playing around with the attack animator and nothings helped does anyone know what could be the issue here? maybe its something with the code? I know idle>attack has no exit time and attack>idle does which is how i have it but its the same result it gets stuck in animation. Please help Thank you!
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
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!
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.
question: i am stuck on animation for some reason. when i right click idle transition window doesn't pop up does anybody knows how to make transition thingy pop up when i click idle?
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
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?
@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?
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
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.
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!
Hey plz help me!! I was in middle of video and when i was writing code in PlayerAttack script it shoes an error for projectile.SetDirection It says 'Projectile.SetDirection(float)' is inaccessible due to its protection level Plz help if u can
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
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"
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.
Select the fireball object, add an animator component to it, create a new animator and assign it to it. Then when you go to the animator window you should see the new one
You spelled it game0bject, should be gameObject. Make sure to enable autocomplete to avoid these kind of mistakes: ruclips.net/video/g3sHbFmzq3I/видео.html&ab_channel=qubodupDev
I get an error stating that: "'Fireball' AnimationEvent 'Deactivate()' on animation 'Fireball_explode' has no receiver! Are you missing a component?" How do I fix this?
Hello , i have done till here . but my fireballs arent exploding . i have done the code from your github too. it works smoothely , but the fireballs arent exploding . please help .
@PandemoniumGameDev I'm having an issue with my fireballs when I shoot it only uses fireballs (1-3) and leaves the rest unused. Also after firing multiple times the game crashes. Does someon know how to fix this?
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
Hi bro, I have a error in Unity, It shows " error CS0122: 'Projectile.SetDirection(float)' is inaccessible due to its protection level" Please help me to fix this error. And also in Unity, In Player attack script ,the Fire Point option not showing.
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!
Just dropped episode 5: ruclips.net/video/jkH3fWpVor4/видео.html
● Support the channel on Patreon or RUclips: www.patreon.com/pandemonium_games
ruclips.net/channel/UCpkMj5b5kl2_YApDvgUCVQQjoin
● Subscribe to the Weekly Pandemonium Newsletter: www.pandemonium-games.com/#:~:text=About%20Me-,Weekly%20Pandemonium,-Subscribe%20to%20our
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
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 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
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
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🥳🥳
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
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.
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 :)
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
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?)
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.
You are the first one from all my subscriptions with the bell activated :D
Thanks man, I feel special now 😁
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
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?
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 😂 🐞
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!
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'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 👍
Omg this tutorial is awesome! My dragon is spitting giant fireballs! Thanks man!
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
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?
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
TNice tutorials might just be the first motivational comnt ive ever seen on a tutorial vid. ga thanks bro
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?
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
Another incredible tutorial, I am learning alot from your style, straight to the point and quick!
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.
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 :,(
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
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?
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
the animation from idle to attack doesn't work. can anyone help?
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?
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
Hey so after entering code to shoot multiple times, after I take my first shoot the second stays at firing point, any fix?
Figured it out had to change projectile speed on each fireball, but now my fireballs do not explode on impact
Make sure the collider is a trigger
@@PandemoniumGameDev i have the same problem and my collider is trigger and idk why it doesnt work
@Pandemonium Games same problem here
Make sure you enter a Speed for all you balls in the inspectors window under Projectile script component. Also make sure all the balls have gravity Scale set to zero, any other value will make the balls fall down and not follow a straight trajectory.
whoever is having this problem, try changing your attack cooldown value in inspector
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.
@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?
and for some reason I'm not dealing damage to the enemies either. a bunch of weird stuff that has just come up.
@@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.
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?
my script doesnt regonize "horizontalInput" and idk whats wrong with it
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
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
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
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?
it keeps saying 'Player' AnimationEvent has no function name specified! help me if you can
3.28 I can not make transition from idle to attack what should I do can you help me please?
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
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?
Can you please help me? When i shoot the fireball, it travels fine but when it hits a wall, it just disappears instead of exploding. Also, everytime i click, i get the "NullReferenceException: Object reference not set to an instance of an object" error
did you find out how to fix it, I got that error too after changing the lifetime value around
@@1wntv its so long ago that i dont remember, but i think that i either found a solution on stack overflow, or i gave up on the project altogether
@@1wntv You probably forgot to add the projectile script to all the fireballs object
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
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 need help!
my player is only doing the attack animation when i jump and press mouse button what to do
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
'Fireball' AnimationEvent has no function name specified!
Help please
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?
Please help me! When I shoot, all animations hang, but when I shoot the second time, the animations hang
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)
Might be the fact that the animation transitions to Explode right away. Check if you have a trigger on the Idle -> Explode animation.
Thanks Pandemonium, this is such a huge help. Best wishes🤩
hey, I have this issue where when I shoot the projectile, it instatnly transitions into the explosion. there are no colliders infron it just doesn't move and stops exactly at the firepoint
Im pretty behind but when i shoot my fireballs they come out perfect but my character gets stuck in its animation ive tried playing around with the attack animator and nothings helped does anyone know what could be the issue here? maybe its something with the code? I know idle>attack has no exit time and attack>idle does which is how i have it but its the same result it gets stuck in animation. Please help Thank you!
my explode animation wont play and the on trigger enter 2d is on yellow color not blue i cant get it to turn blue
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
Did you solved it?
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!
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.
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.
Dude, you are a legend. Great explanation no BS
question: i am stuck on animation for some reason. when i right click idle transition window doesn't pop up does anybody knows how to make transition thingy pop up when i click idle?
Hello I am getting an errror when I shoot the fireballs and is saying 'player' AnimationEvent has no function name specified
can someone help me i keep getting this: error CS0122: 'Projectile.SetDirection(float)' is inaccessible due to its protection level
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
me too
@@ninjaheroes6263 u have to change the speed in all the fireballs manually
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?
@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?
make sure that the fireball holder is not a child of the player and is separate
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
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.
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!
In the player attack script it is saying that Projectile isn't a unity component. these videos have so far been very helpful.
Hi @PandemoniumGameDev can you help me please? I have to push mouse button twice for the animation to work?
@Pandemonium do you have some tutorial for projectile shooting at mouse position? :)
Thank you so much for making stuff in soft a lot easier to understand.
Hey plz help me!! I was in middle of video and when i was writing code in PlayerAttack script it shoes an error for projectile.SetDirection
It says
'Projectile.SetDirection(float)' is inaccessible due to its protection level
Plz help if u can
can you help me with it please if it is solved by you
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
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"
yo a quick question how to change the keys used to go right and left in the "PlayerMovement" script
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?
hey i am not getting the fireball animator is showing old animator of play how i csn make new animator for fireball plzzz reply
Select the fireball object, add an animator component to it, create a new animator and assign it to it. Then when you go to the animator window you should see the new one
@@PandemoniumGameDev i have but is not showing
i have this how can i fix it? :( Assets\Scripts\Projectile.cs(32,9): error CS0103: The name 'game0bject' does not exist in the current context
You spelled it game0bject, should be gameObject. Make sure to enable autocomplete to avoid these kind of mistakes: ruclips.net/video/g3sHbFmzq3I/видео.html&ab_channel=qubodupDev
My fire balls just stay in one place and i get the error "object refrence not set to an instance of an object" how do i fix this?
I get an error stating that:
"'Fireball' AnimationEvent 'Deactivate()' on animation 'Fireball_explode' has no receiver! Are you missing a component?"
How do I fix this?
Sounds like one or more of your fireballs don't have the projectile script attached.
@@PandemoniumGameDev Thank you!
Hello , i have done till here . but my fireballs arent exploding . i have done the code from your github too. it works smoothely , but the fireballs arent exploding
. please help .
for some reason the projectile collision isn't registered and the projectile does not explode...
@PandemoniumGameDev I'm having an issue with my fireballs when I shoot it only uses fireballs (1-3) and leaves the rest unused. Also after firing multiple times the game crashes. Does someon know how to fix this?
i have this problem too, mine only uses fireballs one. did u get the answer to fix that?
Help pls. My fireball, when hitting nothing, just explodes out of random without touching anything. What can I do to fix it?
hello, i’m having an issue where whenevr i fire the fireball, it appears but doesn’t move, and it explodes when my player touches it, any ideas?
Hey I had the same problem have u adjust the speed on your fireballs mine was on 0 I tweaked them to 10 and it worked fine maybe it will work for u 😁
FINALLY, UR A LIFE SAVER I FINALLY FOUND A REAL TUTORIAL WITH SERIES!
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
Hi bro, I have a error in Unity,
It shows " error CS0122: 'Projectile.SetDirection(float)' is inaccessible due to its protection level"
Please help me to fix this error.
And also in Unity,
In Player attack script ,the Fire Point option not showing.
same error have you fixed that error?
my character isn't shooting, and for some reason the jumping sort of deactivates itself.
What can I do?