Answer the question
In order to leave comments, you need to log in
How to change particle speed in Unity via script?
Every 10 seconds I need to change the particle speed (Start Speed value). Repetitions can be done through a coroutine, this is understandable, but I have absolutely no idea how to change this value through a script.
Answer the question
In order to leave comments, you need to log in
Here you go
private ParticleSystem ps;//ваша система частиц
public float Value = 1.0F;//типа скорость которую через корутину меняете
void Start()
{
ps = GetComponent<ParticleSystem>();//получаем систему частиц
}
void Update()
{
var main = ps.main;//хз что но оно надо (не разбирал)
main.startSpeed = Value;//начальная скорость равна значению
}
//корутину сделайте сами)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question