I’m having some trouble scripting what should be a relatively easy construction script, but I am not able to understand how this works:
So I want to set up some meshes to appear at some certain areas within a box collision component. However, whenever I get the extents, it’s only returning me the default values set in the BP, not the extent values set on the instance in the level, which is causing the results to be useless and unpredictable.
Hey same problem here, and i would like to avoid to create a vector variable for this since we could use the box extent variable but it always return the x:32 y:32 z:32 default value in construction script, is thig a bug ?
I had a similar situation for my conveyor actor.
I create a series of meshes to form a conveyor belt and use a flexible volume to move everything inside it.
When you spawn a box volume dynamically, it will always be 32x32 by default. In order to scale it to a desired size, you would need to divide that value by 32x32 and use that as scale values.
As you can see in the graph, Im dividing the overall desired length (Segments * MeshSize.X) by the box extent. If that is 32, or whatever, doesnt matter. The box will alwazs scale correctly.
The FVector BoxExtent is protected so one of the functions GetScaledBoxExtent() or GetUnscaledBoxExtent() should be used to access the value. I believe the box component functions are not firing before the construction script of the actor holding the component so you will get the class defaults.
It would be best to use a variable in the Actor to set the box extent and reference elsewhere or wait until begin play.