Hi, so I've been searching on the wiki for around 15 minutes now, and i still can't find anything that helps me. So i decided to post it on here, and hopefully get some help from all the awesome coders on here.
So I'm making this thirdperson thingy, and i want to know how i can lock it at a certain angle, so you only can move your mouse left and right and not up and down.
Here's my code:
[CODE]
function MyCalcView(ply, pos, angles, fov)
local view = { }
view.origin = pos-(angles:Forward()*100)
view.angles = angles
view.fov = fov
return view
end
hook.Add( "CalcView", "MyCalcView", MyCalcView )
hook.Add( "ShouldDrawLocalPlayer", "MyShouldDrawLocalPlayer", function( ply )
return true
end )
[/CODE]
Thanks a bunch for taking time out of your day to help me.
view.angles.p = whateveryouwant
[QUOTE=SkitZz;47155336]-snip-[/QUOTE]
Lock angles.p to whatever value you want (e.g. view.angles = Angle(45,angles.y,angles.r) )
Thanks a bunch for your help, but even though i set view.angles to an angle, I'm still able to freely move the mouse around. It puts the CalcView at just the angle i want, but I'm still able to move the mouse freely around.
I only want the player to be able to move the mouse left and right.
Check my post out. Someone wanted something similar.
[url]http://facepunch.com/showthread.php?t=1450050&p=47089482&viewfull=1#post47089482[/url]
[QUOTE=Pandaman09;47155434]Check my post out. Someone wanted something similar.
[url]http://facepunch.com/showthread.php?t=1450050&p=47089482&viewfull=1#post47089482[/url][/QUOTE]
This was EXACTLY what i was looking for. Thank you so much.
Sorry, you need to Log In to post a reply to this thread.