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 ?
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.
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.
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!