Skip to content

Instantly share code, notes, and snippets.

@aleannox
aleannox / FixClothBounds.cs
Created April 17, 2020 19:27
[Unity] Fixes wrong Skinned Mesh Renderer bounds occurring with Cloth component
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
// Fixes wrong Skinned Mesh Renderer bounds occurring with Cloth component.
// Attach this to camera.
//
// Idea: Before camera determines culling, we override the automatically computed
// bounds with our own for all game objects with a Skinned Mesh Render in the present scene.
// In this example, we use the bounds of the undeformed mesh