How to Set the Particle Start Speed Property?

I add a Particle System Component into my player object.Now I want to change the value of its particle start speed in C# script.But I find that the Visual Studio Code appear a warning,like this:
9657722--1374614--upload_2024-2-22_10-49-51.png
So how should I set this property? I really need your help,please!

You have to first get the main component from the particle system.

var main = myParticleSystem.main; // plug in myParticleSystem in Inspector
main.startSpeed = 2f; // all done!

The problem was solved successfully. Thank you for your help

Please use the General Graphics or Scripting forums, the particle system is not a 2D feature. I’ll move your thread for you though.

Thanks.