KiffShark Posted November 14, 2012 Share Posted November 14, 2012 Hi everybody I want lower angle in players camera (vertical axxis).. I believe that default is 180(quasi) in the vertical axxis... from top to floor And I'd like lower like 150... I don't know.. There is something that I can do? and in horizontal axxis? 180º would be nice.. Thanks!! (Sorry about my english D: ) Link to comment
uhm Posted November 16, 2012 Share Posted November 16, 2012 I think the only solution would be to create a new camera handling system and that's a pretty advanced thing to do.. Check out the client function SetCameraMatrix I think you could just update the camera matrix every 200 ms using a timer function and set X, Y, Z to the player position. But then you would also need to do some calculations because you don't want the camera inside the player. And then there's the handling of moving the mouse right and left for viewing controls... As far as I know, there's no easy way to do this. Link to comment
myonlake Posted November 16, 2012 Share Posted November 16, 2012 (edited) I think the only solution would be to create a new camera handling system and that's a pretty advanced thing to do..Check out the client function SetCameraMatrix I think you could just update the camera matrix every 200 ms using a timer function and set X, Y, Z to the player position. But then you would also need to do some calculations because you don't want the camera inside the player. And then there's the handling of moving the mouse right and left for viewing controls... As far as I know, there's no easy way to do this. Good try, but wrong. The camera would look very very annoying even at 50ms. The only way to do this is to use onClientPreRender. Not tested, should work though. Client-side lower = true function lowerCamera() local x, y, z = getElementPosition(localPlayer) setCameraMatrix(x, y, z - 2, x, y, z) end addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientPreRender", root, lowerCamera) end ) addCommandHandler("togcamera", function(cmd) lower = not lower if lower then removeEventHandler("onClientPreRender", root, lowerCamera) setCameraTarget(localPlayer) outputChatBox("Resetted camera position.", 0, 255, 0, false) else addEventHandler("onClientPreRender", root, lowerCamera) outputChatBox("Lowered camera position.", 0, 255, 0, false) end end ) Edited November 16, 2012 by Guest Link to comment
denny199 Posted November 16, 2012 Share Posted November 16, 2012 Ehm, onPlayerJoin is only server side myonlake [ use onClientPlayerJoin ] Link to comment
Castillo Posted November 16, 2012 Share Posted November 16, 2012 onClientPlayerJoin is only triggered for remote players, he has to use onClientResourceStart. Link to comment
myonlake Posted November 16, 2012 Share Posted November 16, 2012 denny199 said: Ehm, onPlayerJoin is only server side myonlake [ use onClientPlayerJoin ] Thanks for the heads up, forgot to change that totally. Solidsnake14 said: onClientPlayerJoin is only triggered for remote players, he has to use onClientResourceStart. You're right, edited my code. Link to comment
KiffShark Posted November 16, 2012 Author Share Posted November 16, 2012 It situates the camera in&from the feet to the sky I'm doing first person shooter mode and I want this: Link to comment
uhm Posted November 17, 2012 Share Posted November 17, 2012 Thanks myonlake, that's a much better way to do it indeed. But Kiffshark, your image suggests you're trying to decrease the field of view? If so the following is not relevant. Yesterday I played on a server that featured first person view while driving vehicles. It didn't always work and you couldn't look any other way but forward, but I think it might be a good resource to play around with for your purpose . https://community.multitheftauto.com/index.php?p= ... ils&id=844 [Edit: turns out you can look left, right, behind, just not by mouse] Also, if you haven't already checked it out: https://community.multitheftauto.com/index.php?p= ... rst+person Link to comment
KiffShark Posted November 17, 2012 Author Share Posted November 17, 2012 ok, the problem I had was that pedrotation is attached to camera's direction (I like in this way) but if I look too down (to the floor) the ped rotates like if he doesn't know where to go... because of looking vertically to down not give him any horizontal direction... that's why I want something to can't look so down and fix this bug well, sorry about my english, I think it can be understood Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now