RenderMeshUtility and RenderMesh won't show up in IDE

I’m currently teaching myself the EntityComponentSystem. However, I want to set up Entity rendering I am am running into multiple issues.

From the documentation, I am gathering that I need to use the RenderMeshUtility in order to be able to add graphics.

However, even though I have downloaded both the Entities and Entities Graphics packages, I am unable to use the RenderMeshUtility or RenderMesh in my code.

It doesn’t show up as a useable class and I can’t find it in the code autofill…

Here’s my code so far, I don’t know if I set it up incorrectly:

using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Rendering;
using Unity.Transforms;
using UnityEngine;
using UnityEngine.Rendering;


[GenerateTestsForBurstCompatibility]
public class EntitityManager : MonoBehaviour
{
    [SerializeField] Mesh mesh;
    [SerializeField] Material material;

    private void Start()
    {

        Unity.Entities.EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
        Entity entity = entityManager.CreateEntity(typeof(Level));

        entityManager.SetComponentData(entity, new Level { level = 1 });
  
        
    }


}```

If your code is in a separate assembly, you’ll need to add a reference to Unity.Entities.Graphics in your asmdef.

Note that a more convenient way to create renderable entities is to use subscenes, baking, prefabs, etc. I also see you’re creating entities in a MonoBehaviour script - in ECS it is more natural to place most of your code inside a system.

What’s the asmdef?

Yeah, I was following a tutorial because I’ve never worked with ECS before. This is a whole new world for me :sweat_smile:

I know you said you downloaded it, but have you actually installed the entities graphics package as well?

Yes. Every necessary package is installed.

I’m assuming you don’t have one if you haven’t specifically created one.

When you use RenderMeshUtility are the errors displayed only in the IDE or does the code also fail to compile in Unity?

It’s not really an error, more like I can’t even use it.
It doesn’t show up as a usable class.

You can still type the code to see if the issue is just on the IDE side, or if it actually completely refuses to compile for some reason. (It’s possible to encounter occasional desync between Unity and Visual Studio. I’ve had much more luck with Jetbrains Rider regarding issues like these.)

Try:

var test = typeof(Unity.Rendering.RenderMeshUtility);

Does the console show a compilation error when you switch back to Unity?