GameDev Tutorial: Howto make enemies Flash and Explode in Unity

GameDev Tutorial: Howto make enemies Flash and Explode in Unity

Lost Relic Games

5 лет назад

37,831 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

KHNUX SORA
KHNUX SORA - 21.05.2022 21:49

hey man....i got an error mine is melee attack so i set my attackhitbox on the OnTriggerEnter2D so when the player strikes the enemy it will get hit. i set a Tag for the attackbox..but i got this error Value cannot be null everytime i strike

Ответить
ArcticDogz
ArcticDogz - 08.04.2022 00:07

Nice one Lost Relic - using this in my project now

Ответить
Magic by Derek
Magic by Derek - 02.03.2022 06:29

Thank you.

Ответить
D THE CHEMIST
D THE CHEMIST - 25.02.2022 03:55

Do you have any visual methods to follow for Enemy AI where after you die they stop attacking? I already have a call code for its actions working for movement, attacking and following but once my health is at 0 and im dead i want the enemy to stop all action. And yes my project is 2D sprites

Ответить
Elena Valéria
Elena Valéria - 27.11.2021 01:44

Did some of these methods change in Unity 2021? I typed the same code as you did and unity is saying that the type or namespace "collision" could not be found ;/

Ответить
Matt Noszlopy
Matt Noszlopy - 12.08.2021 03:17

Thanks for this! I was creating animations for everything that got it. Saved me so much time.

Ответить
DRUMAT!C
DRUMAT!C - 20.06.2021 04:35

Do u have a any tutorials on applying sprite fx animations to existing sprites? (Attack hit explosion attached to enemy sprites) 🙏 thanks so much

Ответить
Garu
Garu - 13.04.2021 06:42

Nice tutorials and clean to follow, Thankyou so much :D

Ответить
G-Dev
G-Dev - 16.03.2021 23:38

Thank you my Brother

Ответить
Cloud C
Cloud C - 10.03.2021 14:29

so fucking useful

Ответить
Ozan
Ozan - 04.02.2021 19:43

After I died 1 or 2 times, the particles dont appear. PLS HELP.

Ответить
Ghost Potato
Ghost Potato - 30.01.2021 07:48

when i do this myh character makes the explosion but he doesnt dissapear he just stays there what do i do? (i am using oncollisionenter2d to kill the enemy with a bullet)

Ответить
ahmed mohamed
ahmed mohamed - 10.01.2021 23:34

HELP pls .... when i hit the enemy he doesnt flash at all tho he dies(dissappear) after 5 hits ......idk why i tried everything and its not working pls help!!!

Ответить
Nico Brent Atinon
Nico Brent Atinon - 07.01.2021 23:31

It's fun listening to you because you yourself is excited! Truly a passion!

Ответить
Studio Primitive
Studio Primitive - 30.12.2020 04:23

This is awesome! A great way to acknowledge enemy damage without interrupting animations! Thanks so much!

Also, as a side note I couldn't get this to work with a private matFlash variable. It would make the spriterenderer disappear completely. Instead I opted to make the material matFlash public, and drop in the WhiteFlash material I made and remove the code that pulls it from the resource folder. This worked like a charm!

Ответить
Kamogelo Maimela
Kamogelo Maimela - 18.11.2020 18:04

Nice tutorial man

Ответить
Fon Gaming 101
Fon Gaming 101 - 29.10.2020 00:27

Thanks John..

Ответить
Orhan Avan
Orhan Avan - 24.09.2020 00:18

Looks nice! Please make more megaman tutorials :))

Ответить
xSephironx
xSephironx - 09.08.2020 07:10

Is there a reason why you didn't just change the color of the sprite renderer?

Ответить
Reggie craig
Reggie craig - 08.08.2020 10:00

very helpful. Thank you

Ответить
Wander
Wander - 14.07.2020 04:09

Thanks for the video, but damn it takes longe to get on the flash part xD

Ответить
emirhan okut
emirhan okut - 09.07.2020 06:27

can you add subtitles please

Ответить
Ahmad Kaoje
Ahmad Kaoje - 03.07.2020 02:39

I need help pls, when ever the bullet hits the enemy it pauses how do i fix it ???

Ответить
Jaime Rojas
Jaime Rojas - 28.06.2020 01:53

Really nice and fun thanks

Ответить
Hobby Technology
Hobby Technology - 22.06.2020 08:32

I gotta say, I had a lot of VERY poorly implemented time-based events in my game, thank you so much for showing me that Invoke() exists!

Ответить
Sunil Pal
Sunil Pal - 12.06.2020 09:07

I followed each & every step d way you did,I added the WhiteFlash in Resources, along wid tagging the Bullet to bullet tag(one you added in d comments box),then too my bullet is not hitting enemy,it is just passing beyond the enemy,Please help,I know I have did a minor mistake,but I can't figure it out

Ответить
Sunil Pal
Sunil Pal - 11.06.2020 06:25

U r Awesome man,Keep up d good Work

Ответить
Sebastian Castro
Sebastian Castro - 05.06.2020 21:49

Hey, new big fan of your vids, they're pretty useful. I'm having a bit of a problem tho, my animation simply doesn't show on the Game tab but is does on the Scene tab. I'm pretty sure is layers problem but I don't know how to solve it. Someone help me, please.

Ответить
Fr1tz
Fr1tz - 18.05.2020 18:12

Hey, uhm, do you know by any chance if you can do this in ue4? Ive searched everywhere but this is the closest tutorial about the 2d player/enemy getting damaged and flashing white. Thanks in advance if you do so

Ответить
Anjobee
Anjobee - 01.05.2020 08:41

I don't have the white flash in my resources folder.

Ответить
Doge Lord
Doge Lord - 28.04.2020 04:19

I tried this on Unity but the bullet passes the enemy and I got a error saying “Tag: Bullet is not defined.

Ответить
Adventuresbit
Adventuresbit - 10.04.2020 17:43

Hi John! I just wanted you to know that your tutorials are the best, not only for the right answers but also because you are pretty fun boy.
I've been developing my own game in a while now and I can say that you helped me quite a bit.
Thanks.

Ответить
Maria Isabel Gomez Rodriguez
Maria Isabel Gomez Rodriguez - 09.04.2020 23:39

Hi! Thanks for the tutorial :) Do we have to create the ResetMaterial just like we did with the Whiteflash material?

Ответить
Matt Green
Matt Green - 08.04.2020 23:04

I just randomly came across this tutorial while searching for something else. Your hit flash implementation was better than mine so I updated my project to use your method. Many thanks for the video and for the information!

Ответить
Mohammed Sami Uddin
Mohammed Sami Uddin - 26.03.2020 19:30

The particles render behind the background of the game is there any solutions for this

Ответить
Robert Torres
Robert Torres - 21.03.2020 20:22

Great video. I had a quick question. This is working great for my player characters that use ranged weapons, but when I use a melee weapon I run into the following issue. When it strikes the enemy, the appropriate damage and effects occur. I set my AttackHitBox for the weapon as a trigger, so I don't run into any issues with never really hitting the enemy. However, once I effectively hit the enemy, unless I move away from the enemy (or more precisely I take the hit box area off the enemy) it will not reset the attack function. So I can sit there hit the enemy, it performs correctly once, then hit it an infinite number of times doing nothing. If I move away...it will reset and work. Any idea on what I am missing or doing wrong? So if I am using OnTriggerEnter2d and the enemy never leaves it will never enter again. Thank you ahead of time!

Ответить
Mattéo
Mattéo - 18.03.2020 13:48

is it not better to use public gameObject ? For the prefab explosion

Ответить
Kok Wing Leong
Kok Wing Leong - 14.03.2020 10:36

the whiteFlash still not working??!!

Ответить
GLassy Studio
GLassy Studio - 28.02.2020 17:56

Thanks ... l will add this video in my libary

Ответить
FD G
FD G - 23.02.2020 23:44

When I put in the code for the Particle Effect in Visual Studio it doesn’t work

Ответить
Rafael Ochôa Mello
Rafael Ochôa Mello - 18.01.2020 23:13

I'm new to coding in unity/c#, but it's not better use a StartCoroutine to do the Blink/ResetBlink part ?

Ответить
nick hayes
nick hayes - 18.01.2020 17:23

The particle sysstem tool is very frustrating.
when experimenting you click diffrerent settings on/off to see what it does etc... sometimes when you click stuff (looping) for example all the particles disappear but then clicking the box again doesn't bring them back and nothing you do from there brings them back so you have to delete the particle system and start again! anyone else experience this???

Ответить
Drew Plays
Drew Plays - 03.01.2020 06:07

turn that bug into a game hahah

Ответить
Professor X
Professor X - 25.12.2019 08:21

Thanks for talking normally. Some of these guys doing Unity tutorials talk like they're trying to sell you something.

Ответить
whapy
whapy - 25.12.2019 00:57

Man, you videos are awsome, great job!

Ответить
OZI-G-BE
OZI-G-BE - 21.12.2019 14:34

I needed this tutorial for a completely different reason that solved my problem
Liked and subbed

Ответить
Andy
Andy - 16.12.2019 01:14

hello great tutorial.. i need some help. when I make multiple enemy prefabs of the same enemy, whne I damage one enemy , all enemies get the same damage even if my bullet doesn't touch them.

Ответить