OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: nominesine on 28 Jun 2007, 17:22:30
-
How do I use the setPos command to place an object X meters in front of or behind the player (i.e not X meters north or south of the players position)?!?
-
_pos = [X,Y,Z]
_obj setPos (player modelToWorld _pos)
Y > 0 = in front
Y < 0 = behind
X > 0 = to the right
X < 0 = to the left
Z > 0 = above
Z < 0 = below
BUT
that modelToWorld returns only above ground level Zs.
So, for example, you have your player over a mountain, 100m in front of him there is a deep valley and you want to place a bird 100m in front of it. Well, modelToWorld will return a Z at the same ground altitude od the player, that is 0. So the bird will be placed 100m in front of him, but 50m below (for example).
-
Thanks. I love these new commands. :clap:
*solving*