- Home /
How to get Zerg Tentacle-like effect (see example in post)?
Hello there! I've been researching ways to get ribbon like effects working in Unity, and so far the best I've found is using a trail module on a particle emitter set to ribbon with invisible particles so all you see is the ribbon.
I still haven't quite gotten what I was hoping for, which is something along the lines of the tentacles a lot of zerg units have in Starcraft 2. Here's an example (flying guy on the right, forgive the random video!)
Does anyone more experienced know how they would go about creating something like this in Unity? The thing I love about the tentacles is how they stay super smooth without a lot of jagged steps I get from the ribbon module. It also seems to maintain a consistent overall size and shape. To be clear, I don't even know for sure this is done with a particle emitter in Starcraft, but that's all I can think of when I see it.
Any help would be much appreciated. :)
Answer by JonPQ · Aug 28, 2019 at 06:57 PM
yep, you build a straight tentacle on the texture. slap it into a mesh. then use either a vertex shader or pixel shader to apply a sin wave through the mesh/pixels.
vertex shader will be more performant, but require more polygons in the mesh. (it would wobble the vertices) pixel shader will be less performant renderer, but only need one quad per tentacle, but with some wasted overdraw (space either side of the tentacle on the texture, to allow for moving the UV's back and forth)
That's awesome, thanks so much. Which of those methods would be preferred for mobile use? There will only be two of these "tentacles" on screen at the same time.
Welcome. I'd typically use vertex shaders, wherever I can on mobile in preference to pixel shaders. They are really fun and powerful once you get the hang of them. There might be something you can use in this thread.... or close to it... https://forum.unity.com/threads/help-with-a-basic-shader-to-modify-geometry-with-a-sine-wave.85072/
Your answer
Follow this Question
Related Questions
How to make this trail? 1 Answer
Trail Renderer 1 Answer
Trails in just one direction 1 Answer
Trail behind standing player 1 Answer
How can I create glowing trail effect? 0 Answers