Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Making an arrow go into a wall

Teap Tomsen
Registered User
Join date: 26 Nov 2007
Posts: 9
07-11-2008 20:23
I am trying to make a bow that shoots arrows that will go into walls when they're shot at. However the collision events have too much lag and the arrow bounces whenever it hits the wall which makes it impossible to stick itself into the wall correctly. I am wondering if there is any way to fix this.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-11-2008 22:02
Try recording the arrow's position as soon as you get into the 'collision_start' event, turn physics off, and move it back to the recorded position using non-physical movement (e.g. llSetPos() with PRIM_POSITION and PRIM_ROTATION). You might even calculate a position a little "ahead" of the one you recorded to place it "inside" the target.

Hope that helps a little. The only other things I can think of to help with this are: 1.) calculate and possibly refresh during flight the object's trajectory so you can move back to a position that is along it and as close as possible to the point of collision, and 2.) slow the arrow down, possibly using a little buoyancy to help with range so that there is less bounce before a collision even has a chance to do its stuff.
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
07-12-2008 03:48
Sending you a 'sawblade tosser' in world, the note card that comes with it says:

"By TwoPercent Milk.
This was taken from TwoPercent Milk's spare parts bin. It is to be kept open source, and not to be resold, but may be distributed freely.

The SawbladeTosser simply fires a sawblade that sticks into whatever it hits."
_____________________
Teap Tomsen
Registered User
Join date: 26 Nov 2007
Posts: 9
07-12-2008 14:46
Thank you! Something like that is exactly what I've been looking for.