This throws me NIL value in-game.
cl_init.lua:41: attempt to call method 'GetAngleVelocity' (a nil value)
[LUA] print(LocalPlayer():EyeAngles():GetAngleVelocity())[/LUA]
Are there any 'other' ways to get the Angle Velocity of the EyeAngles?
What are you trying to do? The only thing I could think of would be to get the difference of angles and divide it by time.
I'm just trying to do some kind of VM Sway, but I have not enough brain cells to get it working.
I'm pretty sure GetAngleVelocity() is server side so you'll have to send the value from the server to client if you want it to showup for clients, that's why its showing up nil.
Still Nil.
If it would work, it would just be:
[LUA] print(LocalPlayer():GetAngleVelocity())[/LUA]
But GetAngleVelocity() only works on PhysObj, not on players. Also, it's shared, so it works both server and clientside.
A possible workaround is having an invisible object parented to you, and have it like this:
[LUA] print(physobjnamehere:GetAngleVelocity())[/LUA]
[code]
local lastAng = Angle(0, 0, 0)
hook.Add("CalcView", "getViewAngDelta", function(player, origin, angles, fov, nearZ, farZ)
local view = {}
local diff = math.AngleDifference(lastAng, angles)
lastAng = angles
view.vm_pos = origin + Vector(diff.y*10, 0, diff.p*10)
return view
end)
[/code]
Not tested, but should give you an idea
It didn't work, but I got the idea, so I got it working.
Thanks!
Sorry, you need to Log In to post a reply to this thread.