- Home /
error CS0246: The type or namespace name `Particle' could not be found.
Im getting an error saying: Assets/Scripts/Effects/FX_Maker/IGSoft_Resources/Scripts/NcEffect/NcParticleSystem.cs(562,12): error CS0246: The type or namespace name `Particle' could not be found.
The script I have is this:
void LegacySetRuntimeParticleScale(bool bScale)
{
if (m_bLegacyRuntimeScale == false)
return;
if (m_pe != null)
{
Particle[] parts = m_pe.Particles;
m_pe.Particles = LegacyScaleParticle(parts, bScale, true);
}
}
public Particle[] LegacyScaleParticle(Particle[] parts, bool bScale, bool bPosUpdate)
{
float fScale;
if (bScale)
fScale = NcTransformTool.GetTransformScaleMeanValue(transform);
else fScale = 1 / NcTransformTool.GetTransformScaleMeanValue(transform);
for (int n = 0; n < parts.Length; n++)
{
if (IsMeshParticleEmitter() == false)
{
if (m_bWorldSpace)
{
if (bPosUpdate)
{
Vector3 move = (m_OldPos - transform.position);
if (bScale)
parts[n].position -= move * (1 - 1/fScale);
}
parts[n].position -= transform.position;
parts[n].position *= fScale;
parts[n].position += transform.position;
} else {
parts[n].position *= fScale;
}
}
parts[n].angularVelocity *= fScale;
parts[n].velocity *= fScale;
parts[n].size *= fScale;
}
return parts;
}
Which version of Unity are you using?
If I'm not wrong, the legacy Particle system has been completely removed In Unity 2018
Do you have using UnityEngine.ParticleSystem$$anonymous$$odule;
at the top of your script?
unity compiler says: 'ParticleSystem$$anonymous$$odule' does not exist in the namespace 'UnityEngine'
Answer by richardkettlewell · Jun 11, 2018 at 06:23 AM
As Hellium suggests, most likely you are using the Legacy Particle System in 2018.1, but it’s script API has been totally removed in that version.
In 2018.3, the legacy particle system is entirely gone. You may use our updater to update your assets: https://forum.unity.com/threads/release-legacy-particle-system-updater.510879/
Yes, I tried this before and still the same problem. the line public Particle[] LegacyScaleParticle(Particle[] parts, bool bScale, bool bPosUpdate) here where the problem exist.
The updater doesn’t update scripts at the moment but we are working on making this easier. For now you need to do it manually.
Your answer
Follow this Question
Related Questions
How to prevent particle system from restarting when value changes from script? 1 Answer
Customising Particle Effects for exploding rocks?? 1 Answer
Spawning Particle Systems for Gun Sparks 1 Answer
Particle system drifting to a dynamic point 0 Answers
particle systems' physics heavily depends on framerate?? 1 Answer