#Network Parenting Not Working For Me?

1 messages · Page 1 of 1 (latest)

short heron
#

Does anyone know why this code isn't parenting my effect onto my player? It spawns and despawns correctly, but it spawns as it's own object instead of being a child of my mesh.

[Rpc(SendTo.Server)]
public void SetOnFireEffectServerRpc(bool status)
{
    if (status)
    {
        onFireEffectInstance = Instantiate(onFireEffectPrefab, mesh);
        onFireEffectInstance.Spawn(true);

        onFireEffectInstance.TrySetParent(mesh);
    }
    else
    {
        onFireEffectInstance.Despawn();
    }
}
#

Even if I comment out the .TrySetParent(mesh), it has the same behavior. Also without the mesh in the Instantiate it seems to behave the same.