Entity.GetBoneParent

From GMod Wiki

Revision as of 12:40, 12 February 2010 by Mike-Chip (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax Entity:GetBoneParent( Integer boneindex )
Description:
Returns a parent boneindex of a given bone entity
Returns: Integer
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetBoneParent]Entity.GetBoneParent [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionReturns the parent bone of each bone in the entity.
Used onNewerShared.png
Code
function cmdgetboneparent(ply)
	local pos = ply:GetShootPos()
	local ang = ply:GetAimVector()
	local tracedata = {}
	tracedata.start = pos
	tracedata.endpos = pos + (ang * 230)
	tracedata.filter = ply
	local trace = util.TraceLine(tracedata)
	if trace.HitNonWorld then
		target = trace.Entity
		for i = 0, target:GetBoneCount() do
			Msg(target:GetBoneParent(i) .. "\n")
		end
	end
 
end
concommand.Add("getboneparent", cmdgetboneparent)
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox