What is the 3d equivalent to getting the sprite renderer to show a sprite

I’m trying to make a city building game but the tutorial I was going off uses 2D and I wanted to make mine 3D and in the tutorial there’s a bit of code that gets the standard cursor to be replaced with a building until the player places it. I tried using this to see if it would do the same thing customCursor.GetComponent<MeshRenderer>().mesh = building.GetComponent<MeshRenderer>().mesh; but it doesn’t do what I need it to do. What should I do to fix this?

Make a default cube or capsule or sphere or plane or quad.

Now go look at it in the scene, studying it in the inspector.

To SEE it, you must have two things:

  • MeshFilter, which provides a Mesh (in the above cases, one of the built in ones, in your case, perhaps a building you made in a 3D program?)

  • MeshRenderer, which takes the Mesh from the MeshFilter and renders it with certain Materials and other textures.

That’s it.

There will be a collider on the object too. This is not required for visualization, and in many cases may not even match the actual rendered mesh (eg, you could put a SphereCollider on a Cube primitive to make a cube that rolls around).