When you create a trigger box, it has a component on it called a ‘shape’ under which there is a set of values for X, Y and Z called extents.
What else has this and where does it come from? Is there a way of creating an object that is not a trigger that has this component?
I’ll explain what I’m trying to do - I want to create a construction script that allows a level designer to scale the blueprint and then the blueprint will itself scale some sub-objects in very specific ways. THE PROBLEM is that when you scale an object in the editor, the root scale changes and effects the children. The one strange exception to this is the trigger box. When you scale a trigger box the scale stays the same and only the box extents change.
This is very useful for my needs, so I’d like to know where this comes from so I can create a blueprint which, when scaled, changes the box extents of the root component and not the scale.
I can’t create anything called a “Trigger Box,” so I’m guessing you must mean a Box Component, since that has a Shape that contains the extents. The Shape you see is just a group containing some of its properties.
Whenever you scale anything in the editor, you’re scaling the Root Component, whatever that may be. Since all other components are children of the Root Component, they’re all going to inherit that scale. It’s just the way it works. I am not getting the behavior you describe where the Box doesn’t scale. If I use the Scale Tool, either in the Component Editor of a Class Blueprint, or out in the editor’s main viewport, that box changes its scale and its extents remain the same.
But to cut to the root of the problem (badum-chi!) you can do exactly what you describe with a little math in your Construction Script. For instance:
This will force the Box to use the inverse scale of the actor, meaning as you scale the actor, the box will remain the same, forcing you to use its Extent properties to change its size. Similarly, you could use other math operations based off of Actor Scale to make any other component scale in fun and interesting ways.
Just to show you, if you put a box trigger in the world (a basic component) you will see this behaviour where the extents change but not the root scale.