Hello,

I'm trying to implement some line-of-sight detection for an entity in a game I'm trying to make.

From poking around in some of the shooter templates, it looked like c_trace might be a way to do this. However, my attempts to use it so far have not worked. This is the code I'm using at the moment:

Code:
	while (1)
	{
		c_trace(me,ball,IGNORE_ME + IGNORE_PASSABLE + IGNORE_PASSENTS);
		if (you != NULL)
		{
			alert = 1;
		}
		wait(1);
	}


'me' is the entity doing the detection. 'ball' is the player object it is trying to detect. If I understand what I'm reading in the help files correctly, if c_trace finds an entity between the two positions, it should set 'you' to the name of the entity, and therefore the if statement should become true.

However, 'you' never seems to become anything other than null.

Am I misunderstanding how this function works? Is there some other reason this might not be working? Can anyone provide me with another simple method of implementing what I'm trying to do?

Any help greatly appreciated.