TomPlays Posted June 11, 2015 Share Posted June 11, 2015 Hello, I am wondering on how I would make an over the shoulder camera view positioning thing for the character. It'd look something like this. http://s139.photobucket.com/user/macmei ... 3.jpg.html Of course I'd script it, but what would be the functions, etc. Link to comment
Moderators IIYAMA Posted June 11, 2015 Moderators Share Posted June 11, 2015 Check out this example on wiki: https://wiki.multitheftauto.com/wiki/GetCamera I haven't tried it myself, but it might do what you want(if you edit it ofcourse). Link to comment
Dealman Posted June 11, 2015 Share Posted June 11, 2015 That just gets the camera, you'll want to use setCameraMatrix for something like that. Do note that it'll probably take quite a bit of math to get it the way you want. Link to comment
Moderators IIYAMA Posted June 11, 2015 Moderators Share Posted June 11, 2015 Well this will do it, without rendering with setCameraMatrix. But aiming with the gun is kinda impossible. local cam = getCamera() setElementPosition( cam, 0,0,0 ) attachElements( cam, localPlayer, 0.2,-2,0.8, 0,0,0 ) Link to comment
TomPlays Posted June 11, 2015 Author Share Posted June 11, 2015 So, how would I set this up, very new! Link to comment
TomPlays Posted June 12, 2015 Author Share Posted June 12, 2015 Well, here's my code. I have no Idea what I'm doing btw, so if someone could help me :DD function setCameraOnPlayerJoin() local cam = getCamera() setElementPosition( cam, 0,0,0 ) attachElements( cam, getLocalPlayer, 0.2,-15,0.8, 0,0,0 ) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) but i get error attempt to call global 'getCamera' (a nil value) on line 2 Link to comment
Dealman Posted June 12, 2015 Share Posted June 12, 2015 You can not use client-side only functions in a server-side script. Link to comment
qaisjp Posted June 12, 2015 Share Posted June 12, 2015 setCameraMatrix, getCameraMatrix, onClientMouseMove, getElementPosition, getPedBonePosition 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