- Home /
Do SkinnedMeshRenderer.BakeMesh useScale workarounds exist for older (2019.4) versions of Unity?
I'm in 2019.4, and I'd like SkinnedMeshRenderer.BakeMesh to behave similarly to the 2020.3 version when *useScale=true*. I know I can't do this by passing a parameter to the function, because the parameter wasn't yet implemented in 2019.4. Is it possible to recreate the functionality by applying some matrix multiplication to the mesh before calling BakeMesh? and if so, what operations should be applied?
to put this in code, I basically want my code to behave like this:
// 2020.3
SkinnedMeshRenderer smr = ...;
Mesh targetMesh = new Mesh();
smr.BakeMesh(targetMesh, true);
while being limited to options where I can't pass true to useScale. Something like:
// 2019.4
SkinnedMeshRenderer smr = ...;
Mesh targetMesh = new Mesh();
Matrix4x4 magicScaleMatrix = ???
for(int i = 0; i < smr.sharedMesh.vertices.Length; i++)
{
smr.sharedMesh.vertices[i] = magicScaleMatrix.MultiplyPoint(smr.sharedMesh.vertices[i];
}
smr.BakeMesh(targetMesh);
is the second option, or something like it, possible? If so, what does magicScaleMatrix look like?
Your answer
![](https://koobas.hobune.stream/wayback/20220613040630im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Changing material on SkinnedMeshRenderer changes on other objects too 1 Answer
Create arrow to show force and direction 1 Answer
Error CS0103, The name GetComponet does not exist in the current context. 1 Answer
Alternatives to 3D boolean operations 1 Answer
error CS8025: Parsing error help! 2 Answers