Hi everyone, i just have a quick question about using c_trace to place an object where i click. Ok basically i have a crosshair at the center of the screen. Basically what i need is when i click, a crate spawns on the ground, where the crosshair was pointed. Here is what i came up with so far.

Code:
temp.x = 399;
temp.y = 299;
temp.z = 100;
vec_for_screen(temp, view_build);

if(c_trace(temp, vector(0,0,-10000), NULL))
{
	ent_create("crate.mdl", temp, NULL);
}



Its kinda working out. Though it will only go 100 quants for the temp.z If i make it any more it becomes very inaccurate. Can someone help me?

BTW view_build is a camera.

Thanks!

Last edited by binsky33333; 07/18/09 03:20.