OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: RedHouse on 19 Sep 2005, 20:53:07
-
IM creating a sort of super spectateing thing so makeing movies of gameplay in multiplayer will be alot easyier
But I need to know how to find the position 5 meters to the left, right, back and front of a unit so that i can position the cam there.
I already know the code for finding the 5 meters infront and 5 meters behind but i dont know how to find the position for left and right.
Can someone help me please?
-
Simply add or subtract 90 degrees from the direction and use your trigonometric functions.
-
One of these is left and another is right but I forget which. But if you know how to use front and back already I'm sure you can figure it out.
The only different is instead of two minus signs or two plus signs you go with one of each.
[(getpos _unit select 0) + (sin getdir _unit*_number),(getpos _unit select 1) - (cos getdir _unit*_number),0]
[(getpos _unit select 0) - (sin getdir _unit*_number),(getpos _unit select 1) + (cos getdir _unit*_number),0]
-
cheers for the help dudes
*slaps himself in head* what an idiot, change degrees, im so stupid