CowTurbo Posted February 1, 2012 Share Posted February 1, 2012 So, as my math isn't so good as i can get it, i wanna ask it from here. So, i have done that when a vehicele hits marker, the marker move. But, i need to move the marker ALWAYS to the right side of vehicle. So, when i hit it from north, it goes to the left side of vehicle, when i hit south, it goes left side.. i hope u understand. And.. i dont have no idea how to make that. some rotations and positions .. ? Link to comment
NeXTreme Posted February 1, 2012 Share Posted February 1, 2012 You could use a matrix to do this on client side However, you could also do this: -- "vehicle" is the car that hit your marker -- "marker" is the marker that got hit (obviously) px,py,pz = getElementPosition(vehicle) rx,ry,rz = getElementRotation(vehicle) rz = rz -- change this to "rz = rz + 180" if you wish to move the marker to the other side of the car distanceFromVehicle = 7 -- how far away from the vehicle should the marker be mx = px + math.cos(math.rad(rz)) * distanceFromVehicle my = py + math.sin(math.rad(rz)) * distanceFromVehicle mz = pz setElementPosition(marker,mx,my,mz) Probably not the best code, but it should get the job done Link to comment
CowTurbo Posted February 1, 2012 Author Share Posted February 1, 2012 man, i wont hold it in me .. THX MAANN; U MADE MY DAY! You will get credits for sure in my gamemode!! It works well And its better than mine Thx. Link to comment
CowTurbo Posted February 1, 2012 Author Share Posted February 1, 2012 but im i right that i cant destroy "object limit" ? Link to comment
NeXTreme Posted February 1, 2012 Share Posted February 1, 2012 I don't know, I'd say no I guess. 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