Fktor
(Fktor)
May 31, 2015, 10:13am
1
Hey,
pretty new to UE4 here. I’m working on a 2d game and would like to have some generated geometry in there.
Is it possible to:
Dynamically alter the collision shape of a UBoxComponent?
Dynamically alter the collision vertices on a sprite?
I’ve poked around a bit trying to find a way to do 1, but came up with nothing.
what kind of alterations did you have in mind?
Fktor
(Fktor)
June 1, 2015, 9:13am
3
I’d like to change the extents of UBoxComponent or add/move vertices of a sprite collider.
I’m not sure about box components, but I change my CapsuleComponent’s dimensions on the fly for crouching, so I’m 99% sure it should be possible for BoxComponents.
E.g. in my Character:
UCapsuleComponent* capsuleComp = GetCapsuleComponent();
capsuleComp->SetCapsuleSize(newWidth * 0.5f, newHeight * 0.5f, true);
Fktor
(Fktor)
June 1, 2015, 9:55am
5
Thanks.
SetBoxExtent looks like an analogous function for UBoxComponent - I’ll give it a try.
Edit: Yup, it works.
I’m still curious about the answer to #2 , but that might be much harder.