Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

some help, please, with my bow and arrow

Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
01-18-2009 06:44
Someone's given me what would be rather a nice bow and arrow, if only it would shoot straight rather than sideways, to see if I can do anything with it, and I know very little about projectile weapons.

First question. Does it matter a great deal how the root prim of the bow is rotated (it's a really strange angle) ? I suspect it doesn't, since am I not the root prim when I'm holding it? If it does matter, how do I correct for this, and should I be worrying about the angle of the root prim or the prim from which the arrow is rezzed (which is not the root, in this case)?

Second question. The arrow is equally oddly rotated, but i can quite easily relink it to get the root prim to <0,0,0>. If I do this, do I want the velocity v to be <v, 0,0>*llGetRot() if I want it to head off in a straight line along the root prim's x axis?
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
01-18-2009 16:37
To answer your first question:

Yes, the rotation of the root prim does matter. Most weapons shoot along the X axis, so you're going to want the X axis to be rotated the same as the avatar.

In other words, the X axis should be pointing away from you.


To answer your second question:

I would use (v*llRot2Fwd(llGetRot())), where v is the speed of the arrow.
_____________________
Life is a highway... And I just missed my exit.
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
01-18-2009 17:10
Thank you so much. With that assistance I have taken the thing to bits, put it back together the right way round, rescripted it, and it's working fine.
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
01-18-2009 18:44
Glad to hear it ^_^
_____________________
Life is a highway... And I just missed my exit.