Creating Camera far from player

Hey yall!

I’m trying to figure out how to render a particular camera away from a player, and am having soome trouble. The challenge is that if the player’s actual location is far away, the LOD of the camera will be based on the player’s position and not the camera itself. Is there any way (without teleporting the player closer / increasing the lod distance) to base the render distance around the camera’s location?

Here’s an example of the code:

SetCamCoord(camera, camcoord)
SetCamRot(camera, camrotation, 2)
ShakeCam(camera, "HAND_SHAKE", 0.05)
SetCamActive(camera, true)
RenderScriptCams(true, false, 0, true, true)

Not sure if there’s a native that I should be using, but I’d love some advice!

Yes, use SetFocusPosAndVel - FiveM Natives @ Cfx.re Docs with the camera coordinates.

1 Like

Just what I was looking for, Lovely - Thanks! :smiley:

One more question - To disengage this particular native, would I have to call ClearFocus()?

Yep, that should do it.

1 Like