Open techanon opened 2 years ago
I have been having the same issue when working with QVPen. At first, I thought it broke on my end, but it turned out to just be ClientSim. Definitely an issue!
This is because 2 param overload of LineRenderer.BakeMesh(Mesh, bool)
internally references Camera.main
, which does not exist in ClientSim because no active camera is tagged with MainCamera
while ClientSim session.
I suppose overriding the tag of PlayerCamera
object in Packages/com.vrchat.clientsim/Runtime/Resources/ClientSim/Prefabs/ClientSimPlayerLocal.prefab
with MainCamera
should fix this problem, which should have no side effects as long as Camera.main
and GameObject.FindGameObjectWithTag("MainCamera")
are not exposed to Udon, and LineRenderer.BakeMesh(Mesh, bool)
is working in-game anyway.
When trying to create a mesh from a LineRenderer, in ClientSim the behavior is crashing upon calling![image](https://user-images.githubusercontent.com/1837484/186338857-9824e0af-4cb6-4b35-994a-30f2cba18398.png)
line.BakeMesh(mesh, true);
. This call works fine in-game via build and test. I think CS is trying to force use the 3 param overrideBakeMesh(Mesh, Camera, bool)
instead of the 2 param method because the failure mentions Camera being null: