I've tried putting it in the collision_start() function and in a state_entry() function but things still go through it. And now it doesn't even give me the "ouch" when things touch it.
heres the sample code I have:
[/code]
default
{
state_entry()
{
llSetPrimitiveParams([PRIM_PHANTOM,FALSE]);
}
collision_start(integer totalNumber)
{
llSetPrimitiveParams([PRIM_PHANTOM,FALSE]);
integer i = 0;
if(llDetectedName(i) == "electron"

{
llShout(0, "OUCH"

;
}
}
}
[/code]
I also have a attraction script on the same prim, I don't know if it matters but, here it is
[/code]
float ATTRACTIVE_CONSTANT = 0.0;
float SENSOR_PERIOD = 0.1;
default
{
state_entry()
{
llSetPrimitiveParams([PRIM_PHANTOM,FALSE]);
string objName = "electron";
llSetStatus(STATUS_PHYSICS | STATUS_SANDBOX, TRUE);
llSensorRepeat(objName, NULL_KEY, SCRIPTED, 96.0, PI, SENSOR_PERIOD);
}
sensor(integer nDetected)
{
vector totalForce = ZERO_VECTOR;
integer i;
for (i = 0; i < nDetected; ++i)
{
vector r = llDetectedPos(0)-llGetPos();
float rLen = llVecMag(r);
vector f = ATTRACTIVE_CONSTANT*r/(rLen*rLen*rLen);
totalForce += f;
}
llSetForce(totalForce, FALSE);
}
no_sensor()
{
llSetForce(ZERO_VECTOR, FALSE);
}
}
[/code]