Now THAT feels alot more satisfying, when every time I hit the Enviroment or my enemies I’m actually getting a nice little explosion, instead of both the projectile and enemy just vanishing XD
I don’t even know if I will need a separation later to determine with what exactly those fireballs collide and explode, but maybe for other projects it will be useful π
I think I have played enough with projectiles now, so next should be something like an Interface, Main Menu and maybe a Highscore (if i don’t get distracted by doing some more concepts and better 3D models π
Interesting, never needed explosions yet…
Are you using the explosion functions of a rigidbody or a custom one? π
About fireball collision, thats easy to solve with tags. Just create a tag called boxes or something and add a simple if clause in the fireball script, like
if (hit.tag == “yellowBox”){Destroy(hit.gameObject);} π
LikeLike
you realize, that you are telling me how to do it after I said “I learned how to do it”?:P(regarding the tag function that is)
And I actually just used the “OnCollisionEnter” Class, to Initiate particle effects that only last for a second after the Collision with an Enemy or something from the Enviroment.
LikeLike
“I donβt even know if I will need a separation later to determine with what exactly those fireballs collide and explode” – that’s what I gave you the little tip with the tags for.
On the picture it looks like the boxes are flying away from the explosion, thats why I asked. If I understand it correctly now, there will just spawn explosion particles and no force is applied.
Thanks for clarification! π
LikeLike
oh, I meant that I have made a code where I can define per tags with what my projectile is colliding with, but for my shooter it wouldn’t have been necessary to go that way, since fireballs should get destroyed with everything that it can collide with π thats why I said “I don’t know how that knowledge can become useful yet”
and yes you understand correctly regarding the explosion, thats the boxes are flying is because when they move towards the dragon they are colliding with each other when it’s getting too crowded XD
LikeLike
Ah ok makes sense now π
LikeLike