Personal tools

Lua/Client/Character/Functions/GetBoneAngle

From JC2-MP Documentation

Jump to: navigation, search

Returns    Angle
Prototype    Character:GetBoneAngle(string)
Description    Returns the angle of the bone specified.


Example

The following draws a line from the player's head sticking outward:

  1. function RenderHeadLine()
  2. 	local angle = LocalPlayer:GetBoneAngle("ragdoll_Head")
  3. 	local position1 = LocalPlayer:GetBonePosition("ragdoll_Head")
  4. 	local position2 = position1 + angle * Vector3.Forward
  5. 	Render:DrawLine(position1, position2, Color.LawnGreen)
  6. end
  7.  
  8. Events:Subscribe("Render", RenderHeadLine)


Bones reference

Bones Reference.png
Note: All bone name strings are prefixed with "ragdoll_"

See Also