Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Getting a rezzed object to face me?

Cheewha Palen
Registered User
Join date: 27 Nov 2007
Posts: 78
07-25-2008 01:05
Hello,

I am using a hud attachment (a simple prim with a rezz object script) to rezz an object before me. I followed this thread:

/54/8c/240223/1.html

And got good results as far a rezzing the object in front of me regardless of which direction I am facing. But one step further, I wish the rezzed object to face me regardless of what direction I am facing when it is rezzed.

So far the rezzed object faces west each time. Sometimes i am looking at its back side or the side er, sides and maybe i get lucky when i'm facing east its facing me. But I wish it to always face me....

how can I instruct the rezzed object to face the owner, or the object (my hud attachment) that rezzed it?

Thanks!
Urrong Urnst
Registered User
Join date: 12 Jul 2008
Posts: 49
07-25-2008 01:43
try this in llRezObject function where u define rotation use llRotBetween(<0,0,1>, llVecNorm(llGetPos()));

if the object rotates on the wrong axis use diferent vector in beginning like if you would like to rotate on x use vector <1,0,0>. Im sure u get the point now :)
Cheewha Palen
Registered User
Join date: 27 Nov 2007
Posts: 78
07-25-2008 02:48
Thank you for responding, Following your suggestion I replaced this line of code...


CODE

llRezObject(object, llGetPos() + (<10, 0, 0 > *llGetRot()), ZERO_VECTOR, ZERO_ROTATION, 0);



With This:


CODE

llRezObject(object, llGetPos() *llRotBetween(<0,0,1>, llGetPos()), ZERO_VECTOR, ZERO_ROTATION, 0);


And I have two questions.
First, This recomplies but now doesn't rezz the object in question so I think I have it wrong.

Second in the first line of code Jesse used (<10,0,0>*llGetRot()) to adjust for the object rezzing right on top of you. If I am replacing that part of the code it creates another problem.

But if my assessment of question one is correct then question two may not be an issue.

Can you offer any advice?

Thanks
Urrong Urnst
Registered User
Join date: 12 Jul 2008
Posts: 49
07-25-2008 02:54
U changed the code wrong. Dont place that in position. Use that function instead of ZERO_ROTATION. And tell me if it works. If not i have some other ideas of how would u do that. It probably wont work lol but it doesnt hurt to try :) i have to get back home and figure it out in-world.
Cheewha Palen
Registered User
Join date: 27 Nov 2007
Posts: 78
07-25-2008 03:25
Thank you for the clarification.

The prim is a box made up of 8 prims all cubes.

replacing the ZERO ROTATION with the first idea provided would not compile. I replaced everything between the Z in Zero to the semi colon.

going back to Jesse's original I replaced that with your second suggestion. which compiled and rezzed fine. Whereas Jesse's script faces the box west yours spins it 180* to face east each time. I played around setting euler to 0,0,90 which of course faced box south each time etc.
Urrong Urnst
Registered User
Join date: 12 Jul 2008
Posts: 49
07-25-2008 03:35
try this then lol (copy and paste the whole lower code):

rotation my_rot = llGetRot();
llRezObject("object", llGetPos() + (<10, 0, 0 > *my_rot()), ZERO_VECTOR, <my_rot.x, my_rot.y, -my_rot.z, my_rot.s>, 1);
Cheewha Palen
Registered User
Join date: 27 Nov 2007
Posts: 78
07-25-2008 03:48
Ok I am getting a script error landing the cursor between the "t" and the semi colon in

rotation my_rot = llGetRot;

Error is citing that this is not defined within scope.
Urrong Urnst
Registered User
Join date: 12 Jul 2008
Posts: 49
07-25-2008 03:50
ups sry it is: rotation my_rot = llGetRot();
Cheewha Palen
Registered User
Join date: 27 Nov 2007
Posts: 78
07-25-2008 04:06
No worries I appreciate the help

ok this line

llRezObject("object", llGetPos() + (<10, 0, 0 > *my_rot()), ZERO_VECTOR, <my_rot.x, my_rot.y, -my_rot.z, my_rot.s>, 1);

After the first bracket following *my_rot(

I am getting another "not defined within scope error. If I remove ";()" and just leave *my_rot)

Then it compiles but wont rezz.

Sorry man I am having trouble following this line of code so I am prolly not much help on this end...lol
Urrong Urnst
Registered User
Join date: 12 Jul 2008
Posts: 49
07-25-2008 04:13
Yea my brains are dead today. Ill have to make this in sl but im on one old computer now and cant make it here. When i find solution ill post it here.
Cheewha Palen
Registered User
Join date: 27 Nov 2007
Posts: 78
07-25-2008 04:18
No problem, again I appreciate you trying!

Its a small thing really I know the box will rezz facing me in a sense. Depending on what direction I am at the time its either behind beside or in front of me. but the door to it is "at" me. so its not like i hafta walk around it i just hafta turn...lol. But in a perfect world it would rezz in front of me and face me, oh well.


Thanks again and take care!
Urrong Urnst
Registered User
Join date: 12 Jul 2008
Posts: 49
07-25-2008 06:45
Hey i got it. It was an obvious solution but i wasnt sure until i tried it. Instead of ZERO_ROTATION put in -llGetRot() so it would be like:

llRezObject("name_of_object", llGetPos() + (<10, 0, 0 > *llGetRot()), ZERO_VECTOR, -llGetRot(), 1);
Cheewha Palen
Registered User
Join date: 27 Nov 2007
Posts: 78
07-25-2008 10:29
AMAZING!!!!!

Urrong You were on top of that and really worked it out I hope people are taking notes from you coz I sure am!

Thank you for your help that is awesome.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
07-25-2008 14:20
From: Cheewha Palen
Hello,

I am using a hud attachment (a simple prim with a rezz object script) to rezz an object before me. I followed this thread:

/54/8c/240223/1.html

And got good results as far a rezzing the object in front of me regardless of which direction I am facing. But one step further, I wish the rezzed object to face me regardless of what direction I am facing when it is rezzed.


This thread on the same topic provides a solution: /54/06/267357/1.html
_____________________
From Studio Dora