Resize a collision box to match size of mesh in BP?

You can use the values you get from Get Actor Bounds node and adjust the size of your collision box.

I have a parent BP with x amount of children. The children are various items of variou sizes. I want a specific collision box around the mesh in the children. I added a collision box to the parent and nested it under the mesh and they all have it. Good.

Now on event begin play I want the collision box to resize so its just slightly larger than the mesh. Mesh could be an apple or it could be a golf club etc.

Any Ideas on how to do this? I tried getting the mesh transform and setting the box to same with no affect. I also tried the same with scale3d.

Thanks!

As Jacky said about Actors, the Get Actor Bounds node, I would imagine you are probably working with components though, and the corollary there is just Get Bounds (works for primitive components). Primitives are about as high up the hierarchy as one gets unless your dealing with objects, then just “cast” down, and go.

Have a good one!

thanks for the replies guys. I don’t know if I’m using this right, because it still seems to show the same default box size.

Heres what I put in there

hey man. I’m still not quite following. Probably me just being tired. I’m not new to BP at all, I just never tried resizing stuff this way before.

Maybe best if you could describe it in a flow as if you were connecting the ndoes.

I have my mesh and i have my collision box.

i.e…
Mesh > Get world Scale > next node ? join to set on collision box?
Collision Box > Get unscaled box extent > next node? Set… something?

I think im not really understanding how its handling sizes, cuz I feel like theres 6 different ways I’ve done this where it should have worked. get the size of mesh, set box to size of mesh. seems straight forward. I can’t believe I cant get this to work heh. but “scale” seems to be 1 for everything relative to itself. So scale of an apple is 1. scale of a car is 1. they technically the same but obviously drastically different… so i dont know how to get the ACTUAL size of object one and make object2 the same size

ok, the box “extent” is not measured in the same way as a mesh. It’s 2 to 1, also you need to be taking a look at the scaling values for a box extent, there is the “unscaled” (i.e. extent/size before scaling is applied), and the scaled size, (size/extent after scaling is applied). I always set the scaled size to one, and then the alter the scaled size of the Box Collision itself.

I got i to work like this.

I just need need to play with the sizing a bit to make it how i want.

thanks for the help guys!

1 Like

get local bounds actually worked better

Never ever argue with success, it just might say “to hell with you, and turn to failure!” lol

Have a Great day!