I have a prefab (it’s called Burning.prefab) and it’s a particle system which transform is 0,0,0.
In code I instantiate it to a cube
private void CatchFire()
{
if(!isBurning)
{
var prefab = Resources.Load<ParticleSystem>("Prefabs/Burning");
burningParticleSystem = Instantiate(prefab, Vector3.zero, prefab.transform.rotation, transform);
burningParticleSystem.Play();
//Done twice just to see if it would work
burningParticleSystem.transform.position = Vector3.zero;
isBurning = true;
}
}
Problem is, if the cube’s absolute position is e.g. (6.24, -4.46, 0.015) than my particleSystem as a child of the cube is at this relative position. Instead of (0,0,0) relative to the cube, it’s (6.24, -4.46, 0.015) relative to the cube. I just want it to have 0,0,0