Enemy drop coins after killed ?

Updated on January 13, 2017 in Answers
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
4 on January 12, 2017

What is the best way to make my enemy drop coins or diamonds after killing him ?
using particle system or spawn object ? what you suggest ?

  • Liked by
Reply
1 on January 12, 2017

Particle systems are just graphics, objects can add functionality. Just try to do something and try to make it work. If you need help with that, feel free to post, but first try and then ask for help.

on January 13, 2017

Yes. my problem is with particle system. Is work good but i can’t count it. Example, if cube hit particle ball it disappear, but i can’t count the number of balls hit the cube.

 int P_ball = 0;
 void OnParticleCollision(GameObject other) {
 if (other.CompareTag("cube"))
 {
 P_ball = P_ball + 1;
 Debug.Log("Particles : " + P_ball );
 }
}

This what make me looking for another solution.

Show more replies
  • Liked by
Reply
Cancel
1 on January 12, 2017

Excellent question.

Depending on what style of graphics/functionality you’re aiming for I’d say it depends (as Or Aviram suggests). If you want it to simply look pretty and add visual effects, then particle effects might be the best way to go. But if you wanted to attach scripts (which I think you do) to a coin, for example, then spawning an object (prefab) would probably be the way I’d suggest. And if you wanted to have both effects happen, don’t be afraid to try to make both!

on January 13, 2017

Good point. I will try both. Thank you BinaryBeal.

Show more replies
  • Liked by
Reply
Cancel