Generating a mesh instance from code looks different than one made in the editor, after further testing I noticed that by disabling the use in baked light checkbox in the editor it looked the same as the mesh from code, suggesting that the
mesh_instance.use_in_baked_light = true line in my code is not working. What is the correct piece of code to use?
This is the code I'm using:
var plane_mesh := PlaneMesh.new()
plane_mesh.size = Vector2(400, 400)
plane_mesh.subdivide_depth = 200
plane_mesh.subdivide_width = 200
var mesh_instance := MeshInstance.new()
mesh_instance.name = "water"
mesh_instance.mesh = plane_mesh
mesh_instance.use_in_baked_light = true
(the mesh being generated from code is the blue water, not the green cube)
Image of Mesh from Editor (with use in baked light enabled): https://ibb.co/k1JcpD9
Image of Mesh from Code (for some reason not used in baked light): https://ibb.co/5RgNbKC
Thanks in advance