I’m trying to write a script that when you hold a set bind, it acts like the Arma series free look feature. It enables you to turn your head while walking/running forwards.
This is the Arma feature in action:
Hopefully the end result will be comparable.
I know the ability to make you do this in firstperson is doable. What I’m trying to find out is if I can make the model do this in the world without creating any animations for it.
Can anyone point me in the right direction?
Lua Animations API, maybe?
all he really needs to do is change the neck (or head) bone’s angle. i don’t know how to do this, though.
[LUA]ply:ManipulateBoneAngles( ply:LookupBone( “ValveBiped.Bip01_Head1” ), ply.HeadAngle )[/LUA]
just network ply.HeadAngle and you’re golden
Uh, changing bones won’t affect view angles. Unless you parent view to playermodels head of course, which isn’t a good idea. What you want OP, is CalcView hook.
i thought he wanted more the changing of the playermodels head angles dependent on the direction they’re looking, a little like this
For my free-view I use CalcView and CreateMove hooks to achieve it.
He’s still looking to change the head. He said he already knows about setting the view.
I think we’re trying to figure out how to move the local view and the world model’s head in sync.
Pretty much what I’m trying to do. Just need to find out how to get control over the head. Lua aimation API might work but I’ll play around with it.
Have you tried rotating the head bone like rejax mentioned?
I’d like to try, but I don’t know how to gain control of the models bones in lua.
Here, I just posted a quick how-to right here: http://forum.facepunch.com/showthread.php?t=1386604
For your view-angle sync them and use the previously posted head movement code.