SetCarryableMesh() fails to update carryable mesh when using @editable mesh properties in Verse

Summary

SetCarryableMesh() does not apply meshes assigned via @editable properties in Verse, the carryable keeps the default mesh instead of changing to the selected one.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Devices

Steps to Reproduce

  1. Create a Verse class that includes an editable mesh property:
@editable MeshName : mesh = texturesfolder.meshnameexample

or

MyItem := class<concrete>():
    @editable MeshName : mesh = DefaultMesh
  1. Place a carryable_spawner_device in the island.

  2. In Verse, call:

Carryable.SetCarryableMesh(MeshName)

or

@editable item : MyItem = MyItem {}
Carryable.SetCarryableMesh(item .MeshName)
  1. Start the session.

Expected Result

The carryable should visually update to display the mesh assigned in the @editable field

Observed Result

The mesh does not change, the carryable continues to display its default mesh.

The call executes without errors, but has no visible effect.

The device only updates correctly if a direct mesh reference or a mesh from a hardcoded array is passed instead of an editable variable.

Using a predefined global array containing all mesh references and selecting the correct one manually works, for example:

MeshesBrainrots : []mesh = array{texturefolder.Mesh1, texturefolder.Mesh2}
Carryable.SetCarryableMesh(MeshesBrainrots[Index])

or

Carryable.SetCarryableMesh("texturefolder.Mesh1")

Platform(s)

All

Also been experiencing this,

For anyone also encountering this, an okayish workaround to still having @editable meshes but them being hardcoded is putting this inside a Utils verse script and just updating it with custom meshes you want to use.
That way the behavior is similar to an @editable mesh

Meshes:=enum:
    BaseMesh,Mesh2,Mesh3
(MyMesh:Meshes).ToMesh()<computes>:mesh=case(Meshes):
    Meshes.BaseMesh=>MeshFolder.BaseMesh
    Meshes.Mesh2=>MeshFolder.Mesh2
    Meshes.Mesh3=>MeshFolder.Mesh3
1 Like

How do you create your meshes? I can’t even get the first line of your code to run for me and I have both imported mesh objects and created them with the modeler.

MeshesBrainrots : []mesh = array{texturefolder.Mesh1, texturefolder.Mesh2}
1 Like

You might already use the Meshes as a name somewhere else (probably the auto-generated folder modelling mode makes)

try replacing to this

E_Meshes:=enum:
    BaseMesh,Mesh2,Mesh3

That’s not the line I can’t sort out, it’s the quoted one. I can’t even get my mesh objects to be recognized as a mesh type for some reason

1 Like

Do you have scene graph enabled?

if yes add _asset next to the asset name otherwise it tries to pull the mesh_component

I don’t have scene graph enabled

1 Like

Could you take a screenshot of your assets digest that shows where the assets you want to use are?

you were right, I needed to add “_asset” on the end! Great tip, I hadn’t even looked in that file properly to see how it’s referencing the meshes. Thank you!

1 Like

No problem happy to help <3

Setting that directly in the “SetCarryableMesh” doesn’t work though, your suggestion is to put it in an enum?

Yes, passing a mesh referenced from an @editable does not work, what I did was I made enums then made a function that Converted the enum to a hardcoded mesh, that way I could still keep a “editable mesh” like option for the person who will need to place and setup the device

but your method worked? I don’t have it as an editable, I put it directly in there, so hardcoded.

oh you directly pass the mesh?
Like .SetCarryableMesh(MeshesFolder.MyMesh123_asset) ?

Then idk for me that served as a workaround and would load the mesh

When did you call it? I’m calling it before I even interact with the spawner and it does nothing so far

        if(Carryable:=GameManagerWM[GetSession()].CarryableSpawners[0],Player:=player[Agent]):
            set CarryableDevice=Carryable
            Carryable.SetCarryableMesh(E_Mesh.Mesh.ToMesh())
            #Carryable.SetCarryableMaterial(Material)
            Carryable.Spawn()
            Carryable.ForcePlayerToCarry(Player)

This is the code I use

ohh.. you spawn it right after. I wasn’t doing that, I thought it could be changed on the fly. Got it working now but it would be nice to have editables for this. I can see that when I change it in code it requires a full push though. So just like setting materials in verse UI, there must be something that gets triggered where the material/mesh has to be loaded in to memory or something and kind of “hard coded” on the back end so an editable just would never work in this case.

1 Like

The status of FORT-1000231 changed to ‘Needs Triage’. We’ve confirmed the issue and it’s waiting to be assigned to someone to fix it.