Page 1 of 1

Getting root bone of unit?

PostPosted: 16 Apr 2019, 07:11
by D4rkstalker
Is there a way to get the root bone of a unit?

i.e for ahwassa (xsa0402):
Code: Select all
self:getrootBone()
// returns XSA0402


I'm currently using
Code: Select all
bp.BlueprintId
which causes issues when the bone does not match the blueprint id.

Re: Getting root bone of unit?

PostPosted: 16 Apr 2019, 11:00
by Franck83
Hi D4rkstalker,

It depends on what you want to do. I'm not sure that the unit id always matches the root bone name.
If you want to check the bone names on a specific unit, launch a game on cheat mode. you can show it with the console commands: ren_ShowSkeletons & ren_ShowBoneNames
if you want to apply an fx like CreateAttachedEmitter(self, bone or 0, self:GetArmy()), you can refer to 0 that will point to the root bone.
Unless you got a GetBoneName method on entity objects.

Hope this will help.

Re: Getting root bone of unit?

PostPosted: 16 Apr 2019, 11:07
by Franck83
You can try this method to give you the root bone name : self:GetBoneName(0)

Re: Getting root bone of unit?

PostPosted: 17 Apr 2019, 07:18
by D4rkstalker
That worked nicely, thanks!