Unity 2D Platformer for Complete Beginners - #9 TRAPS

  Рет қаралды 82,344

Pandemonium

Pandemonium

Күн бұрын

In this episode we'll create 4 types of traps: simple spikes, firetraps with pressure plates, arrow traps and a spiked block similar to the crush block from Spelunky.
➤ Arrow Sprite: imgur.com/a/o6dYEkW
➤ Starting Project: github.com/nickbota/Unity-Pla...
➤ Complete Project: github.com/nickbota/Unity-Pla...
Consider supporting the channel on Patreon:
➤ Patreon: / pandemonium_games
➤ Discord : / discord
➤ Itch: nickbota.itch.io/​
➤ Instagram: / pandemonium_games
➤ Twitter: / pandemoniumnick​
#pandemonium​ #unity2dplatformer​ #unitybeginner​
Tags: Unity 2D Platformer for Complete Beginners - #9 TRAPS,unity 2d platformer for complete beginners,unity 2d platformer,pandemonium games,platformer for complete beginners,unity 2d platformer episode 9,unity 2d traps,unity spelunky 2,unity 2d enemy,unity 2d firetrap,unity arrowtrap,unity 2d arrowtrap,unity 2d spikes,unity 2d pressure plate,unity 2d arrow,unity 2d platformer for complete beginners - #7 health system,unity health system,unity health,unity enemy
0:00​ Intro
0:12 Spikes
3:40 Firetrap
12:39 Arrowtrap
20:43 Inheritance
22:25 Enemy Arrows
28:23 Spikehead
37:03 Reseting The Rooms
41:03 Final Result
41:25 Patreon Shoutout

Пікірлер: 194
@syris78
@syris78 2 жыл бұрын
When my fire trap activates it doesn't hurt me, not until i leave the collision area and return to it. In the video when you test your fire trap you jump out of the collision area and then back into it and get hurt so I can't tell if this is how it's meant to be or if I have messed up. If this is how it is meant to be could you possibly tell me how to have it so it hurts the player if they wait within the collision area. Thanks in advance if you find the time to help me out
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
You're right, I changed the script and now it's working properly: pastebin.com/APa4q1H1 I'll pin your comment, hopefully more people see it.
@syris78
@syris78 2 жыл бұрын
@@PandemoniumGameDev Thankyou! It now functions as intended! well, almost.. it hits the character more than once as if its not pulling the command at set intervals using the delay but more like it's trying as much as it can to activate when the player is colliding. Any idea why this might be? Thanks again
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
@@syris78 It his the player once you enter then immediately after the invulnerability effect wears off, I think this is normal but you can increase the IFrames duration to avoid this or decrease the time the firetrap stays active.
@syris78
@syris78 2 жыл бұрын
@@PandemoniumGameDev Sorry i described the situation wrong. I have 3 health and as soon as the trap activates i lose all 3 health. I have the damage set to 1 so i assume something is telling it to do that damage over and over in quick succession. I have my s set to 1 and changing them has no effect. also the firetrap active time has no effect as i die instantly after touching the trap while it's active. It feels like as soon as i collide with the box collider it continuously calls for damage. Sorry if I'm not making sense or asking stupid questions, I'm learning as I go.
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
@@syris78 Sounds like the IFrames are not working properly. Can you take damage from other traps like the spikes while you're in invulnerable?
@gurt6265
@gurt6265 2 жыл бұрын
These are the absolute best tutorials I've come across! Thank you so much for taking the time to make these! Can't wait for more! 🍻
@pianoatthirty
@pianoatthirty Жыл бұрын
Another quick tip for beginners - instead of duplicating the spikes, just change the Draw Mode on the sprite renderer from "simple" to "tiled" - then just drag out the image to the left or right for the amount of spikes you'd like to see!
@andrewvan-heerden359
@andrewvan-heerden359 2 жыл бұрын
These Tutorials are genuinely some of the best out there, you explain everything so well and concisely, with good pacing too. Can't wait for future videos!
@PianoGreenGaming
@PianoGreenGaming 2 жыл бұрын
I love how clear the explanations are! Instantly subbed from the very first one.
@fallenIights
@fallenIights 2 жыл бұрын
My favorite episode so far with all the trap interactions, thanks!
@subharanjanghoshal5597
@subharanjanghoshal5597 2 жыл бұрын
Wow! This is being really interesting now. Learning lots and lots from every video. Eagerly waiting for the coming episodes.
@peterwojtek8468
@peterwojtek8468 2 жыл бұрын
I'll join the crowd in saying your tutorials are spot on ! I'm learning Game Development mainly for sound design purposes -as I have currently no clients as a sound designer, I'm planning on making my own game and your lessons provide an excellent template for making a more in-depth platforming game.
@gamingforthefun3744
@gamingforthefun3744 Жыл бұрын
Great Tutorial. One quick thing. I advise everyone to create two colliders for the firetrap. One is the box collider, for the trap itself, and the other is a capsule collider, for the fire. That way, you can activate and deactivate the capsule collider as the trap activates and deactivates, which allows you to recalculate if there's a trigger when the trap is triggered, and at the same time makes it so only the fire deals dmg, and not the trap itself. I made it like that and it works wonders. I have nothing else to add. Your tutorials have been helping me out tons
@pianoatthirty
@pianoatthirty Жыл бұрын
another beginner quick tip - when you have to rename things (from fireballs to arrows for example), highlight the word, right click and select "Rename" and all your references in the script will also get renamed.
@tyrussell3516
@tyrussell3516 2 жыл бұрын
I've always wondered how games like trap adventure 2 created traps, thank you!
@codinwar2023
@codinwar2023 2 жыл бұрын
Awesome explanation thank you so much 💪
@leodeplayz6589
@leodeplayz6589 2 жыл бұрын
Cool! Thanks, ive been trying to make a game for a long time now!
@user-mz4ho2vb3t
@user-mz4ho2vb3t 2 жыл бұрын
Great vidoes, keep going, dude! Waiting for video with enemies!
@berkcan3475
@berkcan3475 2 жыл бұрын
this should be official 2d game repo thanks for making this
@panostriantafillidis6505
@panostriantafillidis6505 2 жыл бұрын
this video is the longest so far,so i am really excited!
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Next one is even longer :D
@BeastBoy17171
@BeastBoy17171 2 жыл бұрын
Been following this whole tutorial and learning a lot u r a legend really stepped up when brakeys left and the community needed a beginner friendly youtuber. Thank you! On another note when is the next episode coming out do you have an approximation of when?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Released it right now. Thanks for the kind words and glad it helped you.
@bl0095
@bl0095 2 жыл бұрын
You are awesome man!
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
This episode might be a bit difficult considering it's longer than usual. If you have any issues or errors check the scripts on GitHub: github.com/nickbota/Unity-Platformer-Episode-9/tree/main/Assets/Scripts
@aleksandradudukovic7718
@aleksandradudukovic7718 2 жыл бұрын
Can you post link for all scripts, from all videos beacuse it will be very easly to finish game?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
@@aleksandradudukovic7718 There are GitHub projects on all episodes except 1 and 2. You can get all the scripts there.
@aleksandradudukovic7718
@aleksandradudukovic7718 2 жыл бұрын
@@PandemoniumGameDev thank you
@skyherald7390
@skyherald7390 9 ай бұрын
When I enter the next room the spike head does not reset or disappear it still follows me so if anyone has time to help me very appreciated!
@triplea7260
@triplea7260 2 жыл бұрын
thanks for you efforts!
@trex6867
@trex6867 2 жыл бұрын
waiting for the next video man you are awesome
@brainy3429
@brainy3429 2 жыл бұрын
Waiting for next episode Sir.Really appreciate your hard work!
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
You've waited for a long time, sorry. Just released it.
@lukke6720
@lukke6720 2 жыл бұрын
Waiting was worth it :D
@HuddledEragon
@HuddledEragon 2 жыл бұрын
This is a timestamp where I'm at 28:26 for a reminder later to carry on.
@_57u
@_57u Жыл бұрын
Quick performance tip. When checking if a collision hit the player using `if (collision.tag == "Player")`, Do: `if (collision.CompareTag("Player"))` instead.
@unloadedmaster1176
@unloadedmaster1176 Ай бұрын
Why does this help with performance?
@_57u
@_57u Ай бұрын
@@unloadedmaster1176 if you only compare strings then unity/C# will create a duplicate of the string using the 'getter' of the object in question (will be allocated to the heap and need to be garbage collected), taking up space and time. Also, using compareTag will not create the need for extra memory allocation and will simply throw an error if the tag doesn't exist - where a string comparison wouldn't (resulting in a bug you'd have to find).
@unloadedmaster1176
@unloadedmaster1176 Ай бұрын
@@_57u Ohhh okay. I didn't know that. Thank you for the information.
@RaTKZ1
@RaTKZ1 Ай бұрын
Thank you! This actually cleared the memory leak issue I was having.
@seregaplay1770
@seregaplay1770 2 жыл бұрын
Почему так мало лайков? Офигенное же видео (Коммент для продвижения)
@ldmdesign5610
@ldmdesign5610 Жыл бұрын
26:22 'if you would turn the trap around it would still work correctly' - If anyone couldn't get this to work, you have to make the rotation of the arrow trap -180, while the sprite remains at -90. Then it will work. You can also make it -90 and pop it in the ceiling too
@berdinazaryazmuhammedov8750
@berdinazaryazmuhammedov8750 2 жыл бұрын
man, you're doing great things, thanks a lot, im learning from zero. Wish you best of luck. And if you don't mind, could you show your best works? I really want to know your level
@calvinbirch7547
@calvinbirch7547 2 жыл бұрын
These vids r so awsome keep it up! Would love to see you implement a double jump mechanic and possibly sliding down walls, like in many other 2D platformers, so you have to keep moving or else you will slide all the way down.
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Double jump, coyote time and adjustable jump height is planned for episode 11. Sliding down walls it also a good idea, will experiment with it
@garrettbates9124
@garrettbates9124 Жыл бұрын
I experimented a bit and found that wall sliding can be easily implemented by changing the body.gravityScale from Zero to any positive number.
@skyherald7390
@skyherald7390 9 ай бұрын
When I enter the next room the spike head does not reset or disappear it still follows me so if anyone has time to help me very appreciated!
@andrewvan-heerden359
@andrewvan-heerden359 2 жыл бұрын
If you wanted the spike head to go only vertically up and down like i did: 1) comment out all directions in the directions array apart from -transform.up (now spike head can only travel up or down, so it's now an array with only one value) private void CalculateDirection() { // directions[0] = transform.right * range; // right direction // directions[1] = -transform.right * range; // left direction // directions[2] = transform.up * range; // up direction directions[0] = -transform.up * range; // down direction } 2) create a new variable: Vector3 originalPos; (to send spikehead back to start) 3) create a start method, and add: originalPos = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z); private void Start() { originalPos = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z); } 4) create a new method (mine is named restart) and add: gameObject.transform.position = originalPos; private void restart() { gameObject.transform.position = originalPos; } 5) in the Stop() method, add: Invoke("restart", 2); // the restart method will happen after 2 seconds private void Stop() { // stop the spike head, so it doesn't travel forever destination = transform.position; // stop moving attacking = false; // no longer attacking Invoke("restart", 2);//this will happen after 2 seconds } kinda teleports back, but it works
@3m3abdo32
@3m3abdo32 2 жыл бұрын
Finally!!!❤
@Fede-qt4ck
@Fede-qt4ck 2 жыл бұрын
Yessss, please make a tutorial on how to make different levels
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Definitely will in the next episodes
@angelkaki5707
@angelkaki5707 2 жыл бұрын
@Pandemonium , I cannot get the range to show up on my screen, is there anything i did wrong or is it something that i missed before following thru the script? everything works fine but its just the range arrows that i cannot see on my spikehead mosnter, other than that awesome tutorial brother!
@linkg5399
@linkg5399 Жыл бұрын
i have been having an issue with the traps, when i enter a new room ( exampel : Room 1 to Room 2 the traps are not there) but when i go back to room 1 the traps in room 1 are floating, would appreciate if i got any help, Love the tutorials @Pandemonium
@NoldoFeanor
@NoldoFeanor 2 жыл бұрын
nice vid bro, when i stand in my spikes i take damage (1 heart) but if i stay still it wont damage me again
@mrguillotine2972
@mrguillotine2972 10 ай бұрын
Im new on learning unity. I followed all ur step and everything is good, but i have some problem i cant flip direction on arrowtrap projectile
@joaopedrocaruso3329
@joaopedrocaruso3329 2 жыл бұрын
So, i was following the project, but for some reason i can not see some objects in the game view, and to fix i changed the value of the Z axis of the object, however the value of Z that make me see the object is not fixed, some are fixed with 40, others with 20, what may be happen?
@smoothdawg1433
@smoothdawg1433 2 жыл бұрын
I have noticed that when I get hit by an arrow I will take damage, and then automatically fall through the ground. that has never happened before with me when being hit by other things. My problem is not so much the code but making all the connections in Unity so I'm not sure where I'm missing the connection here. Any idea?
@simaugaming6909
@simaugaming6909 2 жыл бұрын
Hello @Pandemonium. I have a problem with the ArrowTrap. My ArrowTrap starts shooting Arrows before I enter the room where the ArrowTrap is. Because of that, the sound of the ArrowTrap plays instance when I start the game. Do you have a solution for that problem? The ArrowTrap should only shoot arrows when I enter the room, right? Thank you :)
@BloodCatters
@BloodCatters 2 жыл бұрын
Hahaha jokes on me 22:32, I had not written the enemy damage code since I found it useless in the latest episodes but I think I should have :D
@viralshneako5779
@viralshneako5779 Жыл бұрын
For the spikehead trap it doesn't register that there is a player infront of it. Instead it just goes in one direction without stopping. I changed the layer mutltiple times but nothing worked.
@TheShutupandgame
@TheShutupandgame Жыл бұрын
So in the arrow trap there are firing and activating but the sprite of the arrow isn’t there. Can anyone help with this?
@cast1594
@cast1594 2 жыл бұрын
can you make a video on how to make a menu for level selection
@g_dev8
@g_dev8 Жыл бұрын
Hello! Can you help me please? Why invulnerability frames doesn't works on arrows?
@ammarajam8278
@ammarajam8278 2 жыл бұрын
I think there's something very wrong with the Spikehead. changing the "range" changes its speed?
@skyherald7390
@skyherald7390 9 ай бұрын
When I enter the next room the spike head does not reset or disappear it still follows me so if anyone has time to help me very appreciated!
@whyDude123
@whyDude123 2 жыл бұрын
I just wanted to know how many video it will takes to complete this series. I watched your first video in this series and it is awesome . Thank you ❤️
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Probably 15. Thanks a lot for watching.
@whyDude123
@whyDude123 2 жыл бұрын
@@PandemoniumGameDev thank you man ❤️
@TheShutupandgame
@TheShutupandgame Жыл бұрын
When I jump on the spikes it does two damage but if I walk through it only does 1 like it should, does anyone have any suggestions are how to fix this issue?
@sanjanar6218
@sanjanar6218 Жыл бұрын
I'll try to be as specific as possible here lol, but my Spikehead isn't moving at all. I copied the script so I don't think there's a problem but it still doesn't seem to be detecting anything.
@GeorgReitterer
@GeorgReitterer 2 жыл бұрын
the SpikeHead is colliding with arrows and stops. this fixes it on the ontriggerenter2d if(collision.tag != "Enemy") Stop();
@ushas3349
@ushas3349 3 ай бұрын
Hi , Thank you for excellent tutorial series. One more issue I got in spriteHead trap. When moving from one room to another the initial position of the enemy saved in that room gets disturbed because of the awake method being called for the next room. So when player moves to prev room, the enemy is not at the reset position!. Thanks Usha
@ushas3349
@ushas3349 3 ай бұрын
I may be wrong! Will wait for your feedback on this. Usha
@sashachaza5137
@sashachaza5137 5 ай бұрын
I need help At the arrow trap part It gives me a hides inherited member warning and I don't understand why it's saying that
@User-OSsjdkdksn
@User-OSsjdkdksn 2 жыл бұрын
tysm you helped so much and im still on second episode, maybe when you finish this series can u pls show how to make it multiplayer? or a multiplayer mode? idk if this wont be possible cuz of other things cuz im still only on second vid
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Trying to turn a singleplayer game into a multiplayer is usually a bad idea. If you're going for a multiplayer you should start planning for it right away because the differences in the code are very big, so I don't see this tutorial turning into a multiplayer one. Maybe another one in the future.
@User-OSsjdkdksn
@User-OSsjdkdksn 2 жыл бұрын
@@PandemoniumGameDev ok thank you!
@gloryjaw4327
@gloryjaw4327 2 жыл бұрын
Well , you can write override after void to remove the warning at 27:53. Not that it matters, but it will show you that this method is overwritten in this class.
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Yep that would work. Didn't want to explain what override is because this video is long enough.
@ToastysTaken
@ToastysTaken Жыл бұрын
my spikehead doesn't move all the way to the edge, it only moves like only a few studs
@shashanksharma1773
@shashanksharma1773 2 жыл бұрын
Finally new
@shashanksharma1773
@shashanksharma1773 2 жыл бұрын
CaN you please make different levels on next vedeo
@mraxle9028
@mraxle9028 2 жыл бұрын
hi dude i wanted to ask will you ever make a video how to make it so the player shoots at the mouse so like instead of just shooting infront you can shoot any place on the screen where youre mouse is
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Not planning to do this on this series, makes more sense when you have a gun. Try to adapt this video to change the firepoint angle: kzbin.info/www/bejne/fJisaZadjqaYra8&ab_channel=UnityTutorialWorld
@mraxle9028
@mraxle9028 2 жыл бұрын
@@PandemoniumGameDev thanks bro i rly apriciate this
@mraxle9028
@mraxle9028 2 жыл бұрын
@@PandemoniumGameDev i just asked bc i couldnt find a good video where you could add fire speed, attack cooldown and other fitures that you added with the thing that i wanted to do
@Burr3tos
@Burr3tos 2 жыл бұрын
Kinda late to the party but when i download the complete project it just opens a empty one with just assets and scripts nothing in hierarchy window
@emransultanzai2266
@emransultanzai2266 Жыл бұрын
Hello bro, hope your doing fine, I am getting this error on Trigger enter 2D collider in EnemeyProjectill script" NullReferenceException: Object reference not set to an instance of an object RangeDamage.RangeAttack () (at Assets/script/Enemies/RangeDamage.cs:60) ". can you help me out what's the main issues?
@veeya9188
@veeya9188 Жыл бұрын
Hi! So I've been following your tutorial for awhile now. I seem to do everything else right but I've ran into a problem with the Spikehead section. Everytime my player interacts with the Spikehead, instead of halting on the ground it ignores the ground and continues to go straight down. Any solution to this?
@shiva4752
@shiva4752 Жыл бұрын
Проверь этот кусочек кода, наверно ты как и я пропустил в конце слово Stop private void OnTriggerEnter2D(Collider2D collision) { // SoundManager.instance.PlaySound(impactSound); base.OnTriggerEnter2D(collision); Stop(); //Stop spikehead once he hits something }
@ldmdesign5610
@ldmdesign5610 Жыл бұрын
sometimes my player gets stuck on the start flag, even though it doesnt have any box collider
@SanforTDotSlesto
@SanforTDotSlesto Ай бұрын
player get stuck, and doesn't do die animation when he die on air... any solution to that ?
@garrettbates9124
@garrettbates9124 Жыл бұрын
I got the spiketrap working but for some reason the rays aren't visible? The trap itself works just fine so I know they exist but they aren't visible in the scene even though I have gizmos on.
@scorpiusjones5436
@scorpiusjones5436 Жыл бұрын
Yes, I had that too. I had to start game, then turn on Gizmos while game was running, then click and hold the "Range" word itself to adjust
@laurentiu4649
@laurentiu4649 2 жыл бұрын
Anyone knows why my arrow fly backwards nor forward(to the right)?
@kwinnerr
@kwinnerr 2 жыл бұрын
Are you planning on adding coyote time? I'm trying to figure it out on my own but i can't make it work
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Yes, in episode 11. Double jump, coyote time and adjustable jump height.
@Perf401
@Perf401 2 жыл бұрын
Spikehead getting stuck in terrain. Any solution? I read it might be because we are using transform position, but it's better to use rigidbody.moveposition...
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Make sure to make the collider on it to be a trigger. Otherwise it will collide with the ground and create weird behavior. If it still doesn't work send me a video on Discord.
@pluto3644
@pluto3644 9 ай бұрын
Could anyone tell me why you can't stand on top of the spikes? They have a box collider so surely the player would be able to stand on top off them, but they just pass straight through them.
@pluto3644
@pluto3644 9 ай бұрын
Nvm figured it out - by checking the 'is trigger' box, it makes the player pass through instead of stopping them.
@suni8
@suni8 Жыл бұрын
How did you create the script for Health?
@nothingnoname5048
@nothingnoname5048 2 жыл бұрын
hello, i have this indexoutofrange bug in the atack function, i do have elements on the arrows variable and i also tried it replacing "findarrow" by simply 0, but i cant fix it, i literally copied your code
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Peculiar. Can you send me the code and a screenshot of the error on discord?
@harshagrawal9881
@harshagrawal9881 Жыл бұрын
my Serialize Field is not showing variables of ArrowTrap Script Please help me to get it
@sandwich646
@sandwich646 Жыл бұрын
BRO SAME
@bazej616
@bazej616 2 жыл бұрын
why my spikehead when he attack me its stop not on ground but in the air
@eltolki
@eltolki 2 жыл бұрын
Hi! Great tutorial series. How can i change the projectile direction? Thanks!
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
You mean for the arrowtrap? Just rotate the arrowtrap to face the direction you want to shoot.
@lukashergelashvili3370
@lukashergelashvili3370 2 жыл бұрын
hey, what if i want arrows to be shot right to left instead of left to right? thanks
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Just rotate the arrowtrap to be facing right, or up or down or diagonally for that matter.
@user-vv1up3uf3t
@user-vv1up3uf3t Жыл бұрын
Hi, I have a question about shooting arrows. How can I make a longer interval between their shooting? 1 second is too short a time :(
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
You have the attackCooldown variable that you can change on the arrow trap. Just open the prefab and change that value in Unity
@user-vv1up3uf3t
@user-vv1up3uf3t Жыл бұрын
@@PandemoniumGameDev Oh, it was too easy... Thank you very much and sorry for such a stupid question
@btud8645
@btud8645 27 күн бұрын
Why does my room2 delete all the enemies within it?
@gabormolnar7125
@gabormolnar7125 Жыл бұрын
You said the arrowtrap can be roated, but when you coded the movement of the arrow you didn't accunted for it direction, so if the arrow trap faces the opposite direction, the arrow backs out of it
@Majitsu_san
@Majitsu_san Жыл бұрын
You can change it's direction in scale menu, by adding minus on X axis
@ldmdesign5610
@ldmdesign5610 Жыл бұрын
I figured it out. instead of changing the rotation of the sprite, you change the z rotation of the arrow trap to -180, and then it works
@nataxshub8462
@nataxshub8462 Жыл бұрын
Hey! 27:55 the method still highlighted and Unity all the same writes "method is inaccessible due to its protection level" and doesn't let me run the game. Though I did change the level from private to protected, so I don't understand whats wrong. How can I fix it?
@nataxshub8462
@nataxshub8462 Жыл бұрын
sorry, I've figured this out - I just forgot to save the EnemyDamage method :D
@Pityon22
@Pityon22 2 жыл бұрын
Is it just me or can you stand on firetrap before it activates (not move at all) and it does no damage?
@kalonianhydra996
@kalonianhydra996 2 жыл бұрын
I had the same problem. Try to disable the box collider of the fire trap and then immediately enabe it like this: active =true; GetComponent().enabled=false; GetComponent().enabled=true; It worked for me
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
@@kalonianhydra996 Good solution, I missed this when testing
@mraxle9028
@mraxle9028 2 жыл бұрын
hi i mabe found my problem i think its with the int at 33:03 how do i write the int without having to write everything by my self?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
You mean the for loop? Type in: for and press Tab twice.
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Double check your code with this script: github.com/nickbota/Unity-Platformer-Episode-9/blob/main/Assets/Scripts/Enemies/Spikehead.cs
@mraxle9028
@mraxle9028 2 жыл бұрын
@@PandemoniumGameDev thanks it helped alot
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
@@mraxle9028 Works now?
@BillybobJeff16
@BillybobJeff16 2 жыл бұрын
when i leave the room the spike head deactivates but wont reactivate
@divyanshagrawal8626
@divyanshagrawal8626 2 жыл бұрын
How can i download its assets???
@sanskarsalunkhe82
@sanskarsalunkhe82 Жыл бұрын
How to remove that On triggerenter 2d error under public class base.OnTriggerEnter2D
@nutsforstrongbones100
@nutsforstrongbones100 Жыл бұрын
i think you must go to enemydamage script and change the ''private void ontriggerenter2d'' to ''protected void ontriggerenter2d'' its at around 20:30 where he says it btw
@calinenachi8244
@calinenachi8244 Жыл бұрын
Hi there @Pandemonium. I copied the SpikeHead code exactly as you mentioned in the video. But in the inspector appeared an error: "The associated script can not be loaded. Please fix any compiling errors and assign a valid script. What can I do? Please help!! Appreciate it!!!
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
Check if the class name matches the file name, this is usually the issue with this error.
@viralshneako5779
@viralshneako5779 Жыл бұрын
@@PandemoniumGameDev I was having an issue with the spikehead trap where when it detects the player it attacks it but doesn't stop after it either hits the player or doesn't I added the stop that you said to do in the video but it doesn't work
@mraxle9028
@mraxle9028 2 жыл бұрын
so im on 33:34 and i dont see the red lines and yeah i pressed the gizmos button and now im rly confused
@mraxle9028
@mraxle9028 2 жыл бұрын
so i finished the tutorial and it dousnt work i have no idea why but the spyke head doese nothing
@freestylerak6655
@freestylerak6655 Жыл бұрын
@@mraxle9028 check if you have applied CalculateDirection() method or not inside the CheckForPlayer() method. I did the same mistake.
@mraxle9028
@mraxle9028 Жыл бұрын
@@freestylerak6655 thanks bro a bit late but better late then never
@sanjanar6218
@sanjanar6218 Жыл бұрын
@@freestylerak6655 I've already done that, but the gizmo still doesn't show up for me. For reference, I copied the entire script so it should be fine but it's somehow not. And of course, the spikehead doesn't seem to move.
@freestylerak6655
@freestylerak6655 Жыл бұрын
@@sanjanar6218 dont copy paste script bcz its hard to find the problem if something goes wrong. so write code from start and keep testing every step so when things doesnt work you know the problem. i also once copied the entire script but that didnt worked so i started again and everything worked.
@sanskarsalunkhe82
@sanskarsalunkhe82 Жыл бұрын
Downloading arrows getting me issue all the arrows are coming in one image only
@sanskarsalunkhe82
@sanskarsalunkhe82 Жыл бұрын
Please help me out fast I am doing my project related to it
@luciaansaldi5518
@luciaansaldi5518 Жыл бұрын
My friend I have a problem with the arrowtrap, if you can help me I'll be very gratefull. Wait for your answer.
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
Hey there. What's the problem?
@jankiktavy
@jankiktavy Жыл бұрын
kzbin.info/www/bejne/a3bIpKl5fJ6SfKM when spikehead hits collider it stops, how to keep spkehead collided and stoped when it is in my direction? for example I am under platform and when spikehead sees me, it will move and hit platform, when spikehead sees me again in this direction, it ignore platform (and collider) and hits me. How to stop moving spikehead when it is collided and in my direction?
@quotes612
@quotes612 2 жыл бұрын
When I press play, my arrows (instead of going sideways) float upwards. Any help/ suggestions?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Yeah, make sure to keep the rotation on the arrow objects to 0 on all axis. If this doesn't work DM me on discord
@quotes612
@quotes612 2 жыл бұрын
Thanks
@triplea7260
@triplea7260 2 жыл бұрын
Hello! can you make a video for double jumping in next episode its really important for me!
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Hey there, I have it planned for episode 11 which is coming next week.
@triplea7260
@triplea7260 2 жыл бұрын
@@PandemoniumGameDev Thanks alot sir!
@Fede-qt4ck
@Fede-qt4ck 2 жыл бұрын
Bro, my spikes are not showing up, like i deleted the background and they still not appear, have u got a solution please?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
1. Check the Z position (should be 0 for the parent object and all the child objects of the spikes) 2. Check the sorting layer on the sprite renderer 3. Check the scale, maybe they're really small If it doesn't work Discord me
@Fede-qt4ck
@Fede-qt4ck 2 жыл бұрын
@@PandemoniumGameDev tysm, the spikes were in Z=10, i fixed it perfectly
@muhammadsubhankhan3376
@muhammadsubhankhan3376 Жыл бұрын
Spikes are not working in my case as i jump on them anybody has same issue? please help @pandemonium
@gameswithparzival4971
@gameswithparzival4971 Жыл бұрын
make sure boxCollider2D is set to trigger.
@matejkunstelj7852
@matejkunstelj7852 Жыл бұрын
where did youget the arrows
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
First link in the description:imgur.com/a/o6dYEkW
@matejkunstelj7852
@matejkunstelj7852 Жыл бұрын
cool
@shadoeplayz4709
@shadoeplayz4709 2 жыл бұрын
37.03
@Big-Image
@Big-Image 2 жыл бұрын
The variables for Fire Point and Attack Cooldown are not showing in the inspector. Am I doing something wrong? using UnityEngine; public class Arrowtrap : MonoBehaviour { [SerializeField] private float attackCooldown; [SerializeField] private Transform firePoint; [SerializeField] private GameObject[] fireballs; private float cooldownTimer; private void Attack() { cooldownTimer = 0; fireballs[FindFireball()].transform.position = firePoint.position; fireballs[FindFireball()].GetComponent().SetDirection(Mathf.Sign(transform.localScale.x)); } private int FindFireball() { for (int i = 0; i < fireballs.Length; i++) { if (!fireballs[i].activeInHierarchy) return i; } return 0; } private void Update() { cooldownTimer += Time.deltaTime; if (cooldownTimer >= attackCooldown) Attack(); } }
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
I think it's because the Enemy projectile script doesn't exist yet or doesn't have the set direction method, keep going, the fix is a bit ahead in the video.
@Big-Image
@Big-Image 2 жыл бұрын
@@PandemoniumGameDev I'm very sorry for the toxic behavior, I just get really stressed when things don't go my way.
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
@@Big-Image asking a question is not toxic behaviour, all good :) feel free to ask if something else goes south. You can also join the discord other members might help you quicker than me
Unity 2D Platformer for Complete Beginners - #10 ENEMIES
52:05
Pandemonium
Рет қаралды 140 М.
how to make a Discord Bot
10:03
Shreyash Sarkar Editz [An 𝐀.𝐢.𝐭.𝐲 member]
Рет қаралды 12
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 118 #shorts
00:30
Don't eat centipede 🪱😂
00:19
Nadir Sailov
Рет қаралды 21 МЛН
What happened to Italy's Skyscrapers?
12:20
The Present Past
Рет қаралды 452 М.
Improve your Platformer’s Jump (and Wall Jump) | Unity
8:12
Unity 2D Platformer for Complete Beginners - #7 HEALTH SYSTEM
23:17
10 British Companies That Destroyed Their Reputation Instantly
11:31
How to make a BOSS in Unity!
21:54
Brackeys
Рет қаралды 655 М.
2D Shooting in Unity (Tutorial)
21:12
Brackeys
Рет қаралды 1,2 МЛН
Unity AUDIO MIXER Tutorial | Unity 2D Platformer Tutorial #17
7:49
Самый СТРАННЫЙ ЧИТЕР | CLEX #shorts
0:54
CLEX
Рет қаралды 4,4 МЛН
#pomni #angela
0:13
My Angela2
Рет қаралды 11 МЛН
esto no es un juego, es la vida real...
0:18
ORION
Рет қаралды 12 МЛН