Skip to content

"Selection mesh" of actors with a procedural model do not update in the editor to match updated meshes #2920

Open
@ax95

Description

Issue description:
When procedurally generating meshes using the How to generate procedural model tutorial as a base, I have encountered a bug wherein generating a new mesh in the editor doesn't appear to update whatever the Flax editor uses to raycast against whenever picking into the scene using the standard TransformGizmo. In other words, the "editor collision mesh" of an actor as used for picking scene actors isn't updated alongside the Mesh.UpdateMesh() method, and no such method to update it manually seems to be exposed. Reloading scripts and reloading the project does seem to update this "editor collision mesh" for each actor with a procedurally generated mesh, but it is far from a viable solution out of an iteration time/level authoring standpoint.

The expected behavior is that one would be able to select an actor with a procedurally generated mesh in the editor, regardless of how often the procedural mesh changes. My suggestion is to expose whatever method is used to update this "editor collision mesh" through C# code on the editor side. Unless there is already a method somewhere hidden within the FlaxEditor namespace that solves this exact issue, I consider this to be a sizable bug.

Steps to reproduce:

  • Follow the How to generate procedural model tutorial
  • For our purposes, follow the Custom script editor tutorial, and make one for the ModelGenerator script
  • Create two UpdateMesh methods, each procedurally generating a significantly different model
  • Hook each UpdateMesh method up to two buttons using the custom script editor
  • In the editor, generate the first mesh
  • Click on the actor to select it: observe that it can be selected as expected
  • Generate the second mesh
  • Click on the actor to select it: observe that it can only be selected if clicked on where the previous mesh was

Minimal reproduction project:
ProcGen_minRepProj.zip

Flax version:
1.8.6512

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeditor

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions