[NATIVE] SetFollowVehicleCamViewMode not working on all vehicles

1. Describe a detailed explanation of the bug you were experiencing

This native doesn’t work on bikes (maybe on more types).

// 0xAC253D7842768F48 0xC4FBBBD3
// SetFollowVehicleCamViewMode
void SET_FOLLOW_VEHICLE_CAM_VIEW_MODE(int viewMode);

To reproduce (lua):
Call SetFollowVehicleCamViewMode(4)to set first person camera when you are on a bike.

2. Add screenshots if possible

Does not apply.

3. Add a date and time to when it happend (only neccesary when it’s not happening constantly).

Does not apply.

2 Likes

Any news of this issue?

I’ll check it later, I learned to live with it but I think it’s time to check if something changed about it

I think its a FIVEM issue or not? So i like to have first person aim inside all vehicles but this bug broke my plans

Also experience this, kinda ruined my plans for the city being first person only, setting it to 4 returns 0 for some reason.

Edit –

After a bit of research it seems that fivem by default has Allow Independent Camera Modes enabled, and the setting itself doesn’t actually change if its on or not.

Basically what this does is, it remembers your camera the last time you were inside that vehicle, and will set it back to that automatically. So if you liked running around in third person but driving in first, it will remember that and each time you enter a vehicle it will set your camera to first person. Not sure why but for cars it doesnt save it, but for all other types of vehicles it does.

It also seems that bikes dont use the same follow vehicle camera as cars, same with boats etc

I really wish I could figure out how to force first person on bikes tho, my whole city is first person only but if people can go third person on bikes then the whole idea is ruined.

Anyone have any ideas?

Hey all, I hope you all that asked for (@manugo.dev @Baelroak @CansecoDev) see this. I get this working

If you use GetCamActiveViewModeContext() you will have one of the following
ON_FOOT = 0,
IN_VEHICLE = 1,
ON_BIKE = 2,
IN_BOAT = 3,
IN_AIRCRAFT = 4,
IN_SUBMARINE = 5,
IN_HELI = 6,
IN_TURRET = 7

If you use “SetCamViewModeForContext” you can get the first person working for the contexts that you want

For example:
SetCamViewModeForContext(0, 4)
SetCamViewModeForContext(1, 4)
SetCamViewModeForContext(2, 4)
SetCamViewModeForContext(3, 4)
SetCamViewModeForContext(4, 4)
SetCamViewModeForContext(5, 4)
SetCamViewModeForContext(6, 4)
SetCamViewModeForContext(7, 4)

Also, I am working in a mod where you have first person while on foot but with the third person animations, exactly for a city “only first person”, if any of you want updates just ask me

4 Likes

When i try to use the natives im getting 'attempt to call a nil value (global 'SetCamViewModeForContext). Both of them produces the same error on f8 console.

Can you show me the code?

1 Like

I just added the code in a RegisterCommand to test. For example;

RegisterCommand('123', function ()
  SetCamViewModeForContext(2,0)
end)

It doenst work for commands, you need to apply SetCamViewModeForContext in a thread every loop

Seemingly not a bug.