Military Guy Posted June 11, 2022 Share Posted June 11, 2022 How to make a camera Shake if vehicle speed 300+ km/h? Как сделать тряску камеры если скорость машины свыше 300 км.ч? Link to comment
Administrators Tut Posted June 11, 2022 Administrators Share Posted June 11, 2022 As you are asking a scripting related question, I have gone ahead and moved this into the Scripting section. Good luck Link to comment
Hydra Posted June 13, 2022 Share Posted June 13, 2022 (edited) Client: local MIN_VALUE = 0 local MAX_VALUE = 15 function RenderShakeEffect() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then local vx, vy, vz = getElementVelocity(vehicle) local actualspeed = (vx^2 + vy^2 + vz^2)^(0.5) local kmh = actualspeed * 180 if kmh >= 300 then setCameraShakeLevel(math.random(MIN_VALUE,MAX_VALUE)) else setCameraShakeLevel(0) end end end addEventHandler("onClientRender", root, RenderShakeEffect) Edited June 13, 2022 by Hydra 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