UE4 attach to bone

Discuss issues pertaining to the various game/web runtimes of Creature here.
Post Reply
3dmotion
Posts: 4
Joined: Thu Sep 01, 2016 1:13 pm

UE4 attach to bone

Post by 3dmotion » Sun Sep 04, 2016 3:06 pm

Hello, :?:

is possible to link an actor to the creature bones in blueprint or is there any way to make something like socket for creature bones in ue4?

thanks,

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: UE4 attach to bone

Post by chong » Sun Sep 04, 2016 6:50 pm

Hello,

The way it is done with the Creature plugin is via the BP function: GetBluePrintBoneXform(FString name_in, bool world_transform, float position_slide_factor)

You give it the bone name and remember to set doWorldTransform to True. It will return you the world transform along the bone determined by the position_slide_factor. position_slide_factor allows you to "slide" along the bone.

position_slide_factor determines how far left or right the transform is placed. The default value of 0 places it
in the center of the bone, positve values places it to the right, negative to the left.

With the returned world transform, you can then set or attach any collider/external object to that transform which targets the bone of your choice.

Cheers

JoscelinFrost
Posts: 5
Joined: Fri Jun 16, 2017 8:38 pm

Re: UE4 attach to bone

Post by JoscelinFrost » Fri Jun 30, 2017 10:23 pm

Thanks for breaking this down.

So if I'm understanding correctly, you are deriving the transform from the bone, but I'm not totally clear on the attachment step. Are you grabbing the transform and then setting that each frame using tick? Or is there an attachment function that I'm missing?

Any clarification would be much appreciated.

Thanks!

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: UE4 attach to bone

Post by chong » Fri Jun 30, 2017 10:47 pm

Hello,

You get the bone transform, then take that value and set it to your target for each tick.

Cheers

JoscelinFrost
Posts: 5
Joined: Fri Jun 16, 2017 8:38 pm

Re: UE4 attach to bone

Post by JoscelinFrost » Fri Jun 30, 2017 10:50 pm

Gotcha, thanks for the quick response!

Post Reply