Add option to quickly create box, sphere, convex or triangle mesh collider for the selected static model

This commit is contained in:
Wojtek Figat
2025-04-08 12:47:27 +02:00
parent 938d23ce0d
commit 46f842a555
3 changed files with 116 additions and 58 deletions

View File

@@ -320,6 +320,10 @@ namespace FlaxEditor.Modules
SpawnBegin?.Invoke();
// During play in editor mode spawned actors should be dynamic (user can move them)
if (isPlayMode)
actor.StaticFlags = StaticFlags.None;
// Add it
Level.SpawnActor(actor, parent);
@@ -328,10 +332,6 @@ namespace FlaxEditor.Modules
if (actorNode == null)
throw new InvalidOperationException("Failed to create scene node for the spawned actor.");
// During play in editor mode spawned actors should be dynamic (user can move them)
if (isPlayMode)
actor.StaticFlags = StaticFlags.None;
// Call post spawn action (can possibly setup custom default values)
actorNode.PostSpawn();