How can we render a cube in unreal engine 5?
A simplest answer will be: let’s drag and drop a cube to the scene.
That's a great answer! Essentially, what you did was:
StaticMeshActor
to the current sceneUStaticMeshComponent
Why is this static mesh component instance a cube instead of a sphere?
This is because we set the static mesh member variable to the cube static mesh.
Why is this cube white?
It is because we set a BasicShapeMaterial
into the first element of the material array in this static mesh component.
Let’s do a summary:
Top Layer: asset and game world
Of course, to lighting our cube, we also need to put a light into the scene, let’s add a point light.