quakergamer 0 Posted August 14, 2003 Hello everyone, I have a problem. Lets say I want to camcreate an object 300m away from the person executing the script. Well it always create the object 300M AT THE NORTH of the soldier even if the soldier is facing another direction ! How can I make it detect the direction of the soldier and create it always at the front of the soldier even if he is facing another direction than north! Thanks! Share this post Link to post Share on other sites
franze 196 Posted August 14, 2003 Have you tried something like getdir? ie, <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">direction1 = getdir soldier1 Share this post Link to post Share on other sites
quakergamer 0 Posted August 14, 2003 Have you tried something like getdir?ie, <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">direction1 = getdir soldier1 Yea I have tried getDir command but I still cant make the objects camcreate in the good direction .. Share this post Link to post Share on other sites
BraTTy 0 Posted August 14, 2003 Like this..... _person = this select 0 _personpos = GetPos _person _persondir = GetDir _person _newx = (_personpos select 0) + 300 * Sin(_persondir) _newy = (_personpos select 1) + 300 * Cos(_persondir) I believe that will get your position 300 meters ahead of you and this is 300m behind _newx = (_personpos select 0) - 300 * Sin(_persondir) _newy = (_personpos select 1) - 300 * Cos(_persondir) Share this post Link to post Share on other sites
quakergamer 0 Posted August 15, 2003 Thank you franze and BraTTy for your help! It finally works . See ya and thanks ! Share this post Link to post Share on other sites