Forum Discussion
Custom C# script in Mesh ?
Hi,
We are currently exploring the potential of using Mesh for collaborative work. Our existing setup already includes Unity ecosystem with custom packages, scripts, and more. I'm trying to reuse these scripts in a Mesh environment. However I encounter difficulties when trying to use C# scripts in Mesh and I always end up in errors such as:
The game object '...' uses the component '...' in Assembly '...'. This component is not supported by Mesh runtime.
Even with something as simple as:
public class CustomCode : MonoBehaviour
{
void Start()
{
}
}
Is it possible to use C# script in a Mesh environment ?
Thanks for your help.
TAndrieu wrote:
Thanks for the inputs. I'll get in touch with Mesh teams to see how we could adress this problem.
We have some complexe custom objects representing geological data, with on the fly generation, custom shaders, etc... and I was hopping to use Mesh as collaborative plateform. But this does not seem possible in the current state.TAndrieu Thanks for your query. I can confirm there is are no plans to support Monobehaviours in Mesh.
Instead of Monobeviours, we provide two mechanisms (cloud scripting and visual scripting) for adding logic to an environment. This is described in the scripting section of the Mesh Documentation.
(It also might be worth considering Webslates, since they can be used to visualize custom information.)
- lukaszdudziakBrass ContributorYou cannot use your own C# scripts attached to the game object on the scene that will be deployed to Mesh. The only exception is Mesh scripts. You have to convert manually your scripts to Visual Scripts.
- TAndrieuCopper Contributor
lukaszdudziak Ouch, that's a huge limitation 😟.
Do you know if there is a plan to support custom MonoBehavior in the future ?Visual Script is too limited in our case, and we already have too much existing code to port it to VisualScript.
- lukaszdudziakBrass ContributorTAndrieu, I don't think it will be allowed. It could be used to exploit the Mesh app, so it is blocked for security reasons. I understand your concern because many plugins and assets are not allowed to be used because of this.
There is also an option to use Cloud Scripting which is a C# script (it is not monobehaviour) and can be useful to integrate data from other systems into a Mesh environment.
https://learn.microsoft.com/en-us/mesh/develop/script-your-scene-logic/cloud-scripting/cloud-scripting-basic-concepts- TAndrieuCopper ContributorThanks for the inputs. I'll get in touch with Mesh teams to see how we could adress this problem.
We have some complexe custom objects representing geological data, with on the fly generation, custom shaders, etc... and I was hopping to use Mesh as collaborative plateform. But this does not seem possible in the current state.- MalcolmTyrrellMicrosoft
TAndrieu wrote:
Thanks for the inputs. I'll get in touch with Mesh teams to see how we could adress this problem.
We have some complexe custom objects representing geological data, with on the fly generation, custom shaders, etc... and I was hopping to use Mesh as collaborative plateform. But this does not seem possible in the current state.TAndrieu Thanks for your query. I can confirm there is are no plans to support Monobehaviours in Mesh.
Instead of Monobeviours, we provide two mechanisms (cloud scripting and visual scripting) for adding logic to an environment. This is described in the scripting section of the Mesh Documentation.
(It also might be worth considering Webslates, since they can be used to visualize custom information.)