- Home /
How do I use emissionRate in scripting?
Hey, I was searching everywhere but i still dont understand how do i use this varible in script. Is there a way to do something like:
if (Input.GetButton("Fire1"))
{
emissionRate += Time.deltaTime;
}
? I know for some of you this is so simple and perhaps even stupid question, but if someone can give me some reference for this i would really appreciate that. Thanks for helping.
Answer by TobyXD · Jul 15, 2013 at 06:20 AM
If I didn't misunderstand your question. Try the script below :D
public var increaseSpeed : float = 0.5f;
function Update(){
if(Input.GetButton("Fire1")){
particleSystem.emissionRate += Time.deltaTime * increaseSpeed;
}
}
Thank you for this script, but for some reason it doesn't work. Is there any way to make this in java script? edit: I figured it out now :) But thanks for help anyway! :)
Yeah, but the thing is, it doesn't work :/ I figured another way. Like i showed in my question, all what it needed was particleSystem on the front: if(Input.GetButtonDown("Fire1")) { paricleSystem.emissionRate += Time.deltaTime; } That is all what is needed in js script to make it Increase while pushing a button.
Sorry I just misunderstood you question ... -_-|| I will update my answer later~