Cassandra Posted March 2, 2013 Share Posted March 2, 2013 Is there any way? Basically, I am creating a vehicle which will move from one point to another and will be invisible. I want the camera to be attached on that vehicle so if the vehicle moves, the camera moves along with it. Link to comment
PaiN^ Posted March 2, 2013 Share Posted March 2, 2013 Maybe you can get the camera matrix of the vehicle and then set it to yours .. Link to comment
Moderators IIYAMA Posted March 2, 2013 Moderators Share Posted March 2, 2013 or just very basic: SetCameraTarget https://wiki.multitheftauto.com/wiki/SetCameraTarget https://wiki.multitheftauto.com/wiki/GetCameraTarget Link to comment
Cassandra Posted March 2, 2013 Author Share Posted March 2, 2013 or just very basic:SetCameraTarget https://wiki.multitheftauto.com/wiki/SetCameraTarget https://wiki.multitheftauto.com/wiki/GetCameraTarget Well, it says Currently supported element type is: Players Does it still supports vehicles or objects? Link to comment
PaiN^ Posted March 2, 2013 Share Posted March 2, 2013 I don't think so .. Maybe in another version of MTA ..! Link to comment
Moderators IIYAMA Posted March 2, 2013 Moderators Share Posted March 2, 2013 hmm, (I never used it before on vehicles and did not notice that) setElementAlpha ( vehicle,0) -- onClientRender. local vehicle = getPedOccupiedVehicle (localPlayer) -- not needed, when you already have a vehicle if vehicle then local Sx,Sy,Sz = getElementPosition (vehicle) local _,_, pR = getElementRotation (localPlayer) pR = ((pR+90) * 3.141592653 * 2)/360; --edit "90" to change the rotation. local lookAtX, lookAtY, lookAtZ = Sx + math.cos(pR)*5, Sy + math.sin(pR)*5, Sz setCameraMatrix (Sx,Sy,Sz+4, lookAtX, lookAtY, lookAtZ+4)-- +4 high camera end -- updated and tested 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