SetParent/setting transform parents leads to unpredictable and random scaling of decals
I want to parent blood decals in my game to objects their blood particles come in contact with in order to prevent floating blood decals on moving elements of the level.
However, the achieved effect works, most of the time. Seemingly whenever the engine feels like it, it randomizes scales for decals cast on to objects from particles with OnParticleColliison, as shown in the following screenshot.
I have tried to force reset scales by, upon creation, deparenting the decal, resetting its scale to a hard-coded value (being 3.5 for all components of its scale), and reparenting it. This results in especially poor performance, causing roughly 30 MS of CPU time to be spent on the script responsible for casting blood decals with particles.
How do I fix this? Do I suck it up and just only cast decals onto static/non-dynamic objects, or is there some other feature hidden within Unity's codebase somewhere that can help me?
Your answer
Follow this Question
Related Questions
Unintended behavior with setting the position of an animated character in a timeline. 0 Answers
When using a Gameobject variable in a public void in C# it does not show up in button(script) 1 Answer
Unity editor perfect play, test it on android, bugs occurred 0 Answers
Unity Saves Over All of My Project's Scenes, Instead of Just the Scene I Choose. 1 Answer