mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Improvement: Set the camera position offset from the entity
- Modifying the spawn location would previously require adjusting the camera parameters. - This, along with the previous camera change, ensures the camera is always facing the ped
This commit is contained in:
+2
-2
@@ -29,11 +29,11 @@ if ESX.GetConfig().Multichar then
|
||||
local playerPed = PlayerPedId()
|
||||
SetEntityCoords(playerPed, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z, true, false, false, false)
|
||||
SetEntityHeading(playerPed, Config.Spawn.w)
|
||||
local offset = GetOffsetFromEntityInWorldCoords(playerPed, 0, 1.7, 0.4)
|
||||
DoScreenFadeOut(0)
|
||||
SetCamActive(cam, true)
|
||||
RenderScriptCams(true, false, 1, true, true)
|
||||
|
||||
SetCamCoord(cam, Config.Spawn.x, Config.Spawn.y + 1.6, Config.Spawn.z + 1.3)
|
||||
SetCamCoord(cam, offset.x, offset.y, offset.z)
|
||||
PointCamAtCoord(cam, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z + 1.3)
|
||||
|
||||
ESX.UI.HUD.SetDisplay(0.0)
|
||||
|
||||
Reference in New Issue
Block a user