Page 1 of 1
clicked bone name
Posted: Sat Aug 28, 2021 4:35 pm
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 6:23 pm
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 6:35 pm
by davoodice2
Lukas wrote: ↑Sat Aug 28, 2021 6:23 pm
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 9: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: Sun Aug 29, 2021 12:41 am
by davoodice2
synthsin75 wrote: ↑Sat Aug 28, 2021 9: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