I want to spawn a scripthidden object certain meters away from the caller where the caller is facing. I want that distance between the caller and the scripthidden object fixed.
The problem that i have is that i don’t know how to manipulate the distances.
Edit: I found this library which contains a function to what i asked for.
Here is the code:
vector vMyLocation = GetPosition(OBJECT_SELF);
float fAngle = GetFacing(OBJECT_SELF);
vector vSpawn = VAtAngleToV(vMyLocation,15.0,fAngle);//This function is getting a position 15meters away from where the caller is looking at.
location lSpawn = Location(GetArea(OBJECT_SELF),vSpawn,fAngle);
object oPoint = CreateObject(OBJECT_TYPE_CREATURE, "c_invisiblenode" , lSpawn);
DestroyObject(oPoint,2.0);