Download

Scaling objects breaks things in game?

I’m curious as to how to solve this problem. I’m currently working on a VR game where the base mechanic revolves around picking up tiny objects, throwing them, and as they’re released from the user, they grow to full size. After that, the user can pick them up and move them around at will, but they will not grow again.

My initial problem that I found was that if I had the models to scale at scale 1,1,1, the collision boxes did not let me grab the meshes when they were small. So I decided to scale everything in my 3D suite to 1/3 scale, and then when they were released, have them grow to 3,3,3 so that they were 1,1,1 at the start. This solved the initial issue, but there was a new problem. The collision boxes still did not work properly after I did this. On some meshes they did, but on others, they grew and would immediately just fall through the floor.

I’ve tried several things. Most of the models have custom collisions, and the pivots of the collisions matched the pivots of the models themselves. I figured that the issue might be with my custom collisions, but I changed out the custom collisions for simple box and capsule collisions in Unreal, deleting my custom collision. The result was still the same. Models were falling through the floor, vibrating when they were sitting on each other, and there was about a 20% chance of failure in some way.

Does anybody have any ideas or potential solutions for this specific problem? Or for dealing with collisions and scaling in general? Thanks in advance.

What method are you using to scale the object?
simple collision should scale along for static meshes.

Theoretically even complex collision will scale up and down.

this obviously runs at runtime as well, or changing the size of an engine sphere at runtime would cause some of it to clip into the ground.

if you are using blueprints you may need to handle the scaling differently (meaning the objects you grab are blueprints and not static meshes).
In my brief testing for a different game the scaling works fine and collision works as expected.

For my game, they are blueprints, following close to the same logic as the default pickup cube in the VR template. However, as you can see here, on the first time they are released, I’m having it run through a timeline that “Sets Actor Scale 3D.” If you are using a different method that works, I’d greatly appreciate knowing it. But if there’s anything I’m doing wrong here, let me know.

Instead of scaling the actor, scale the component directly.
also, because you are setting simulate physics on the component itself, doesn’t the component start to move independently of the blueprint?

Sorry for the delay in replying, things have been hectic recently.

Well, all of these growing objects don’t have any other functionality other than holding the actor. The actor is set as the root of the blueprint, I believe. You’re saying change out the “Set Actor Scale 3D” node for a “Set Relative Scale 3D” and plugging in the root of the blueprint into that?

Or drag the root to the screen and set the scale when dragging off its pin.

The collisions will not scale up correctly when you scale up the mesh. try putting the mesh ABOVE 0 for x, y and z axis in regards to its pivot. So e.g. for a chair, dont place its pivot at bottom center, but at the bottom edge of the geometry extension. so that all the chairs mesh geometry is in the quadrant x>0 and y>0 and z>0.

@Jakatak. If you can consistently reproduce that, it should be submitted as an engine bug.

the same problem can arise if you scale in one or 2 directions: the collisions gets “asynced” from the mesh.

To demonstrate some of the issues I’m having, here is a video of the tables that are unable to stack on top of each other. The collisions should be fine, as you can see in the screenshot:

And with regards to MostHost LA, here is a screenshot of the updated blueprint. I believe I’m using the correct nodes.

After making that change, I see no difference in some of the issues I’m having:

Also, with regards to Jakatak’s suggestion of placing all of the mesh within the positive axiis…I attempted this as well, and I still got poor results. This time, they were worse though.