Particle Emmiter is not a valid member of its parent?

Im making a weather system all is going great but im getting an error, "Particle Emmiter is not a valid member Raincloud (Raincloud is its parent) this error is driving me crazy and if u could solve it i would be very grateful heres a video showing the error and script

The script is probably too quick and tries to read cloud.ParticleEmitter when particleEmitter isnt even existing yet… Does the script run after the emitters are spawned in?

Hello!

I’m not sure if it solves the problem, but you’re using RainVFX:GetDescendants(), which also includes the Particle Emitters inside your clouds, since it goes through every single Instance under Rain VFX. Maybe you already tried this, but using RainVFX:GetChildren() may solve the issue.

(By the way, it is not necessary to use pairs() or ipairs() anymore. You can just do this instead: )

for _, cloud in RainVFX:GetChildren() do

end

I hope I could help!

2 Likes

Yes the script runs after the emmiters are spawned

Sadly that doesnt work either thanks for trying to help anyways

Ah, I think I’ve found it! You’ve written:

cloud.ParticleEmmiter.Enabled = true

You’ve made a typo at Emmiter, with a double “m”, however they’re called “ParticleEmitter”, with two “t”'s. If I’m correct, this should work:

cloud.ParticleEmitter.Enabled = true
1 Like

haha i thought it was Particle Emmiter… and its emitter thanks for solving this i been stuck for a while!

You’re welcome! I also had my fair share of coding typos.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.