• Touch Camera
  • Camera zooms out when object has particle system child object

There seems to be a bug when focusing the camera on a game object that has children that are particles. When I don't have any particles spawned under my object as children, the zoom works as intended. However if I spawn a particle system as a child under my object, and then try to focus the parent object, the camera zooms all the way out and doesnt respect the focus distance I have set.

Please advise

    WillsCreative here is a quick fix, open GameObjectExtensions.cs and replace that function:

    public static Bounds GetBoundsRecursive(this GameObject go)
    {
    // Selecting all renderers, excluding particle systems
    Bounds b = new Bounds(go.transform.position, Vector3.zero);
    List<Renderer> rList = go.GetComponentsInChildrenRecursive<Renderer>();
    foreach (Renderer r in rList)
    {
    if (r.gameObject.GetComponent<ParticleSystem>() == null)
    {
    b.Encapsulate(r.bounds);
    }
    }
    return b;
    }

    Write a Reply...