Page 1 of 1

clicked bone name

Posted: Sat Aug 28, 2021 8:35 am
by davoodice2
hi.
is there a function that return name of bone that i clicked on?
I want do it without select that bone

Re: clicked bone name

Posted: Sat Aug 28, 2021 10:23 am
by Lukas
Make sure you’ve got the skeleton and mouseVector and use:

Code: Select all

skeleton:NearestBone(mouseVector):Name()
Edit: Wait NearestBone probably returns the bone ID and not the actual bone, if so, use that to get the bone and then get the name.

Re: clicked bone name

Posted: Sat Aug 28, 2021 10:35 am
by davoodice2
Lukas wrote: Sat Aug 28, 2021 10:23 am Make sure you’ve got the skeleton and mouseVector and use:

Code: Select all

skeleton:NearestBone(mouseVector):Name()
Edit: Wait NearestBone probably returns the bone ID and not the actual bone, if so, use that to get the bone and then get the name.
thanks lukas.

Re: clicked bone name

Posted: Sat Aug 28, 2021 1:39 pm
by synthsin75
Yeah, like Lukas corrected in his edit, it would be:

skeleton:Bone(skeleton:NearestBone(mouseVector)):Name()

You could even get this without clicking, in OnMouseMoved, using:

pfx_ScriptName:NonDragMouseMove()

Re: clicked bone name

Posted: Sat Aug 28, 2021 4:41 pm
by davoodice2
synthsin75 wrote: Sat Aug 28, 2021 1:39 pm Yeah, like Lukas corrected in his edit, it would be:

skeleton:Bone(skeleton:NearestBone(mouseVector)):Name()

You could even get this without clicking, in OnMouseMoved, using:

pfx_ScriptName:NonDragMouseMove()
thanks you synthsin75