Search the Community
Showing results for tags 'velocity'.
-
local target = a point with some meters ahead of the hydra. maybe 200 local m1 = createProjectile(hydra,20,hydraleftwingposition,1, target,0,0,0,hydra.matrix.forward) local m2 = createProjectile(hydra,20,hydrarightwingposition,1, target,0,0,0,hydra.matrix.forward) how can i get missiles to the same point or that gather along the way without slowing velocity, i already try setElementPosition and setElementVelocity, findRot and findRot3D but i can't make it work because i don't know how exactly to do it mathematically. can someone help me, pls? Thanks in advance
-
I would like to do a recoil system in such a way that a player who is hit by someone is thrown upwards simultaneously E <---- this is element X <---- point position example x x x x x E x
-
Hello my friends ! I just trying to move an object away when someone fire on it. I created below client and server side codes. Client Side :- addEventHandler("onClientPlayerWeaponFire",root, function (_,_,_,_,_,_,h) if h and getElementType(h) == "vehicle" then triggerServerEvent("onFired",resourceRoot,h) end end ) Server Side :- addEvent("onFired",true) addEventHandler("onFired",root, function (h) setElementVelocity(h,0.1,0.1,0.1) end ) But the problem in here is, when fire in different directions, the velocity / force acted on the vehicle in same direction. Can you please help me to change the force direction of the vehicle according to the fire direction ? I thing maths should be applied in here [ may not :p ]. However, I'm really newbie in some of lua maths. [ math.sine, math.cos, math.tan, math.#%$...BLA.. BLA..]. So, at least little help will very useful !!
-
How to compute Velocity vector of Vehicle turret relative to Global World? I did some calculations and this is what I have been able to reach: local lrotX, lrotY = getVehicleTurretPosition(occupiedVehicle) -- Compute local 3D vector from bearing and elevation math local tVx,tVy,tVz = math.cos(lrotX) * math.cos(lrotY), math.sin(lrotX) * math.cos(lrotY), math.sin(lrotY) Maybe I need to calculate the difference of rotation angles turret and my vehicle, and then to compute Vector by formula above?
- 18 replies