- Home /
Spawn blood particle system prefab where sword hits enemy
How would I do this where my swords hits the player? Like when the player slashes the enemy left, the blood particle system is instantiated and is going in the direction that the sword made contact?
Answer by ifurkend · Mar 06, 2021 at 02:13 AM
The simplest way is to attach a blood particle sys on the blade, set it in world simulation space, add some gravity, use emission "rate over distance" instead "rate over time", add "inherit velocity" (particles flies in the same direction as the game object) and "Limit Velocity Over Lifetime" (for braking particle velocity) Modules.
There are other more performant but restrictive ways (local space, emission over time/burst, no inherit/limit velocity modules) to achieve the same particle motion, but modern mobile devices shouldn't have too much trouble to handle the aforementioned setup.
Your answer
Follow this Question
Related Questions
Issues with destroying a game object 2 Answers
Add 0.5f to Vector.Right on next instantiated object ? 1 Answer
Reference Player When Instantiating A Prefab 0 Answers
Instantiated Object being auto-deleted 0 Answers
How to instantiate within GameObject 1 Answer