I have several objects with complex mesh and collisions.
Both with mesh-collisions
And added collision boxes through components
Can I somehow validate them?
Something like this:
(idiotic solution)
Get static mesh “bounds” and if it’s >= collision “bounds” → print string: “{object_name} has mesh that is bigger than object’s collision”
(unfortunately this will work only from inside of an object blueprint and print the string upon starting playmode)
Would be cooler to have this inside a “validator” of some sort, that can get an array of objects and check them by the code
But this way I’d have to get an array of objects of the same type somehow.
The simplest solution I can think of is to make a validator actor and place it in the level. If you mark a custom event as “Call in Editor” it will appear as a button in the details view. Then you can get all the actors already present in in the level and check their bounds.
You should probably use some specific class on GetAllActorsOfClass which you are certain that has both mesh and a collision because now it marks all static meshes as they don’t have separate collider;
Moreover this code is only looking for BoxCollision and StaticMesh. If you have different colliders or meshes you should revise the code.
This comparison is not good. You should probably check X, Y and Z independently and log if any of the dimensions fail.
If your game is not running you will be able to see the message only in the Output Log;
This only works for objects already in the level. Not for their classes in the Content Drawer;