Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Can you rotate a sensor?

MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
12-08-2007 19:36
Hey guys I was playing with the root prims location but I cant seem to be able to rotate the sensor in that prim here is the sensors line (I need the sensor beam to be accurate as I am trying to make an accurate gun)

llSensor("","",SCRIPTED ,100,PI/80);

I have tried a sensor repeat and it shows that the area above a scripted prim (my guess is .1 Meters and directly above the center of the prim) is the center
any to make it say accurate while rotating the sensor beam?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-08-2007 23:14
to rotate a sensor, rotate the prim it's in... sensors face in the local positive X axis line
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
12-08-2007 23:18
From: Void Singer
to rotate a sensor, rotate the prim it's in... sensors face in the local positive X axis line


I just tried that and it seems that it rotates the whole gun as its in the root prim...heres another question: could I put an invisible prim on the end of the gun and link it as a child prim and it still be able to to work on left click like it does now, or does that have to be in a root prim?
edit: also it seems that if I shoot the top of the target only it works. The "target" is a square prim with a script in it
Trevor Scarpulla
Registered User
Join date: 4 Nov 2007
Posts: 6
12-08-2007 23:46
shot in the dark pardon the pun, but you also may want to try llLookAt, its and auto focus through sensor repeat but might not be what your looking for.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-08-2007 23:56
From: MCM Villiers
I just tried that and it seems that it rotates the whole gun as its in the root prim...heres another question: could I put an invisible prim on the end of the gun and link it as a child prim and it still be able to to work on left click like it does now, or does that have to be in a root prim?
edit: also it seems that if I shoot the top of the target only it works. The "target" is a square prim with a script in it

you could use edit linked parts (the checkbox in the edit window) to rotate the root prim, you could move the sensor script to a different prim, or link an extra prim for the sensor (as you guessed). also assuming that the script requires being in the root, you could unlink and relink the whole object with a differnt (perhaps easier to rotate) prim as root... unink, deselect the prim you want to be root, reselect it and link. that will change your root to the new prim, you may want to take out the script first, then drop it back in after.

without knowing many factors, like:
what size is the sensor cone,
where it the actual cone in relation to the object you're 'firing',
& is the target made up of multiple unlinked prims,
I couldn't guess why it only seems to hit the top half...

oh btw, welcome to the forums =)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
12-10-2007 03:44
ediit: nvm saw your response I'l try that :)
edit2: ok how exactly can I tell where a sensor is pointing? ....actually heres a better question can you rotate by a PI function?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-10-2007 12:20
in the edit window, near the top, there is a drop down box labeled 'ruler mode' change it to local... the pointy end of the red arrow is where your sensor is pointing (make sure you have a single prims selected and edit linked parts checked for multiprim objects)

as for rotating, if you mean just the sesor and not the prim, no, doesn't work. must rotate the prim.... anything that will rotate the prim wil rotate the sensor cone
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
12-11-2007 04:56
ok this maybe stupid, but when its in mouselook (and thats how its setup to fire) it's still shooting higher then the mouselook reticle, but shouldnt it be level if its in mouselook?
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
12-11-2007 07:13
You need to "adjust the site" on your gun and offset it a bit. There is an example gun script on the page below that will show you how.

http://rpgstats.com/wiki/index.php?title=ExampleGun
_____________________
There are no stupid questions, just stupid people.
MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
12-11-2007 07:21
I'll try that but since its using sensors to shoot dont know if it will work