Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Moving into direction

Jack Hathor
Registered User
Join date: 13 Jul 2004
Posts: 10
11-20-2005 04:13
Hi,
My problem is the next;

I have a prime, with a direction. I want to move that prime 5 meters into that (vector)direction.

How to do that ?.

Greetings,
Jack Hathor
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
11-20-2005 05:26
http://secondlife.com/badgeo/wakka.php?wakka=llVecNorm might help:

In outline, you'd be taking your direction vector, norming it, multiplying it by 5 and adding that to the current position.

The scripting is left as an exercise to the learner...:)
Jack Hathor
Registered User
Join date: 13 Jul 2004
Posts: 10
Thanks
11-20-2005 05:39
Thanks for the outline, it turns out to WORK :D

vector newpos = llGetPos();
rotation rot = llGetRot();
newpos += (llRot2Up(rot) * -5);