How to make coins drop from an enemy when they die?

I’ve tried numerous amount of things, from using physics and delta time to drop coins randomly but I didn’t know how to add collision to it.

I’ve tried using velocity, that worked out pretty well the only problem was mimicking that look on that client. That matters because what I want to do is calculate the positions of all the coins on the sever, then spawn them on the client. That way, if a coin was not in their designated location I would know they would be hacking.

I’ve also tried using Bezier curves, these also didn’t work out since there was always a problem with my Y axis and they would never be on the ground. (If I unanchored them, they would fall to the ground at a fast speed and fly off the island)

Any help on this would be helpful, just know that I do have some restrictions:

  1. I must be able to give a coin a random position on the server within a boundary to send to the client
  2. The coin should have like a burst affect, shooting out of the enemy when the die. If you’ve played any game that does things like that you should know.

I could’ve sworn there was more but that was all, I know it may seem like I’m asking for code but I’ve been at this for days and all of the things I’ve attempted have not worked. If you would like to see my code examples to improve on what I did I would be more than happy to.

Thanks

Try using tween instead of velocity for the “bursting effect.” With this, the coins would definitely not fly off the map.

Hope this helps!

Tweenservice could work, I’ll see what I can do

sorry for bump, but you could definitely use Collision groups as well. The coins would collide with the ground, but wouldn’t collide with anything else (although can still fire OnTouched if you keep CanQuery property checked).