is there a way to define UV’s for a particle?
for example, with UV Animation with a Particle Renderer all that is happening are the UV’s are modified each update according to the user settings…
where can we define this through script?
is there a way to define UV’s for a particle?
for example, with UV Animation with a Particle Renderer all that is happening are the UV’s are modified each update according to the user settings…
where can we define this through script?
I’d actually be interested in this myself. I recently hit upon this when doing up some particle effects, and wanted to have a randomly assigned texture (in an atlas) per particle in the emitter.
I wasn’t able to find anything pertinent in the scripting docs.
edit:
On second thought, this might be accessible via the inherited members. Will take a crack and report.
edit2:
And waddaya know, that worked.
//simplified example, just attach this to an emitter
//and set the x and y UV offset and scale
//as appropriate for your texture atlas
var offsetUV:Vector2;
var scaleUV:Vector2;
function Awake() {
gameObject.renderer.material.mainTextureOffset = offsetUV;
gameObject.renderer.material.mainTextureScale = scaleUV;
}
good one LoTekk! ![]()
Hi, sorry to dig up an old thread but this is also what i wanted to do… however the script above changes the material UV settings. Is it possible to change the UV settings of the billboard particle without affecting the material?
I ask because i have 1 atlas with all my particles on and i wanted to have an effect that’s 1 draw call but have multiple materials to offset the UV’s is creating 3 draw calls per particle effect (i say 3 because it has 1 main and 2 sub particle attached in this case)