Last active
August 15, 2019 18:49
-
-
Save ElasticSea/cd751d0240f057a2afc4b3b8ceb311cb to your computer and use it in GitHub Desktop.
Using cloth and skinned mesh renderer in 2018.4 messes up the renderer bounds. The renderer bounds end up being outside camera view and the object is culled and not rendered. Here is a quick fix how to force the renderer bounds to correct position. https://issuetracker.unity3d.com/issues/adding-cloth-component-to-skinnedmeshrenderer-changes-bounds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
namespace _Framework.Scripts.Util | |
{ | |
public class FixSkinnedMeshRendererBounds : MonoBehaviour | |
{ | |
[SerializeField] private SkinnedMeshRenderer skinnedMeshRenderer; | |
private void OnRenderObject() | |
{ | |
skinnedMeshRenderer.localBounds = skinnedMeshRenderer.sharedMesh.bounds; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment