Hey all im trying to spawn some props and it works ok but not how i would like it to work, ATM if you spawn a prop well looking at the ground it spawns correctly but if you look at another prop it spawns half way inside that prop and if you spawn a prop under another prop the possition does not change and it just spawns the prop allthe way inside the existing prop this is my trace ray setup.
I am also fairly new to this so examples would be amazing!
PHP Code:
stock GetCollisionPoint(client, Float:pos[3])
{
new Float:vAngles[3], Float:vOrigin[3], Float:AnglesVec[3], Float:EndPoint[3];
new Float:Distance = 600.0;
GetClientEyeAngles(client,vAngles);
GetClientEyePosition(client,vOrigin);
GetAngleVectors(vAngles, AnglesVec, NULL_VECTOR, NULL_VECTOR);
EndPoint[0] = vOrigin[0] + (AnglesVec[0]*Distance);
EndPoint[1] = vOrigin[1] + (AnglesVec[1]*Distance);
EndPoint[2] = vOrigin[2] + (AnglesVec[2]*Distance);
new Handle:trace = TR_TraceRayFilterEx(vOrigin, EndPoint, MASK_SHOT, RayType_EndPoint, TraceEntityFilterPlayer, client);
if(TR_DidHit(trace))
{
TR_GetEndPosition(pos, trace);
return;
}
CloseHandle(trace);
}
Please any help would be great!
__________________