Summary
I imported a mesh to be spawned with scene graph through the AddEntities function but it will always spawn the lowest quality version of the Mesh. Here is the sample code to spawn in the mesh.
spawn_entity_component<public> := class<final_super>(component):
@editable ParentEntity : ?entity = false
OnBeginSimulation<override>():void =
(super:)OnBeginSimulation()
Print("OnBeginSimulation")
OnSimulate<override>()<suspends>:void =
if:
PE := ParentEntity?
then:
PE.AddEntities(array{Prefabs.ImportedMeshPrefab{}})
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Assets
Steps to Reproduce
- Import a mesh in the content drawer.
- When prompted for FBX import options, set Static Mesh LODGroup to None.
- Once imported, open the mesh’s editor and set the number of LODs to 5
- Create an entity prefab with a mesh component referencing the imported mesh
- Create a class that spawns an entity. (See sample code)
- Create an entity prefab and add the spawn entity component.
- Reference the same entity with the spawn entity component on the ParentEntity editable.
- Put the prefab with the spawn entity component in the world.
- Launch session and observed spawned mesh behavior
Expected Result
The spawned mesh should behave with normal LODs depending on how large the mesh is on the player’s screen. (e.g LOD 0 if the player is close to the mesh, LOD 5 if the player is far from the mesh)
Observed Result
The mesh will always spawn with the lowest LOD, in this case, LOD 5.
Platform(s)
Windows