Hi all,
I’m using Unity 5.5.1f1 Personal Edition. In my script, I declared a ParticleSystem variable:
public ParticleSystem SmokeParticle;
and I’m assigning it from the editor. Then in the script I have:
var smokeEffect = Instantiate<ParticleSystem>(SmokeParticle, hit.point, Quaternion.FromToRotation(Vector3.up, hit.normal));
At runtime, every time this instruction is hit, I get the following exception in the console:
InvalidCastException: Cannot cast from source type to destination type.
UnityEngine.Object.Instantiate[ParticleSystem] (UnityEngine.ParticleSystem original, Vector3 position, Quaternion rotation) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:207)
I have this problem since I updated to Unity version 5.5.1f1, the previous version worked fine with this.
Can someone please explain me what I’m doing wrong?
Thank you all,
FOC