Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

bullet close range

Prognastat Vellhi
Registered User
Join date: 30 Apr 2007
Posts: 16
12-04-2007 15:33
when I fire a bullet with a collission script it works fine upto like 1 step from the other avatar, when I push my avatar up against the other and fire the bullet it wont work. Could anyone help me out with a solution for this?

CODE

rotation rot = llGetRot();
vector aim = llRot2Fwd(rot);
vector pos = llGetPos() + gAimOffset + (aim * 1.0);
llRezObject(gBulletName, pos, aim * gBulletSpeed, rot, gBulletDamage);


that is what it is doing at the moment.
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
12-04-2007 16:09
vector pos = llGetPos() + gAimOffset + (aim * 1.0);

is rezzing the projectile a meter in front of your avatar

vector pos = llGetPos() + gAimOffset;

is probably a sufficient fix.

If you do that, will the projectile collide with your avatar when it rezzes? Answer: Take the speed the projectile will be moving and divide it by 45... Basically, you won't have to worry about the prim causing any collisions until it travels that far. But that may be different in Havok4...