Help editing bone angles of a view model (SWEP Model)
2 replies, posted
So like in overwatch, when mccree shoot inside of his ult, his arm and weapon turns to the targets position, im trying to do the same here (my gun and mccrees arms are the same model).
As you see he aims to the center instead of aming on the targets.
Actually i tried making separeted animations for specific parts of the screen but i wasnt able to make that "separation" properly to i gave up.
I searched on the wiki and i found some functions that manipulate the bones position angles e etc (thankfully).
https://files.facepunch.com/forum/upload/185744/de0b8943-536d-4b38-b7da-50bc78bb107e/temp.jpg
The thing is, when i tried using "manipulatebonesangles" and "setboneangles" with the gun root and the right arm bone, idk if i did right with "setboneangles" but i tested both of the commands and nothing happened even errors.
I use an aimbot position as reference to get the correct angle, but even using normal values for exemple:
ManipulateBoneAngles(PeacekeeperBoneID, Angles( 150, 0, 90)), have no effect too.
Heres the code i used for manipulateboneangles (i used it on the PrimaryAttack event of my swep
within a timer that makes my gun shoot until theres no targets marked on the screen anymore)
local RHandBoneID = self.Weapon:LookupBone( "BONE_0003A" )
local RHandBonePos, RHandBoneAng = self.Weapon:GetBonePosition( RHandBoneID )
local PeacekeeperBoneID = self.Weapon:LookupBone( "Root" )
local PeacekeeperBonePos, PeacekeeperBoneAng = self.Weapon:GetBonePosition( RHandBoneID )
if CLIENT then
self.Weapon:ManipulateBoneAngles(PeacekeeperBoneID, (self:GetHeadPos(self.Aimbot.Target) - PeacekeeperBonePos):Angle())
self.Weapon:ManipulateBoneAngles(RHandBoneID, (self:GetHeadPos(self.Aimbot.Target) - RHandBonePos):Angle())
end
I hope its possible to do with a view model :p
Thanks in advance.
You could always override the angle of the whole model in SWEP:GetViewModelPos, rotating it based on the delta between the screen angle and (theirHeadPosition-playerHeadPosition):GetNoramlzed():Angle() . Also, self.Weapon should just be self
Oh ill try that out then. Thanks.
Sorry, you need to Log In to post a reply to this thread.