Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Magnetism

Jaden Seifert
Registered User
Join date: 4 Nov 2005
Posts: 2
11-07-2005 07:34
I have been trying to build a magnet, and i am missing one vital thing, creating a push on an object relative to the forward axis of the rotation of an object. I was wondering if anyone could post an example of this (i have already elimated the effects of distance and any lack of energy so that isn't a problem).
If that explination isn't good enough, what i mean is, say the object's X axis is pointing North, i want anything near it to be pushed north, and if i rotate the object so it's local X axis is pointing South everything is moved south.
-sorry if it's an obvious question but i'm new
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
11-07-2005 07:40
This should help, llRot2Fwd
_____________________
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
11-07-2005 07:41
vector power = (llGetPos() - llDetectedPos(0)) * -1
llPushObject(key id,nulify_distance_fallof(power),ZERO_VECTOR,FALSE);

i think i forgot nothing
_____________________

tired of XStreetSL? try those!
apez http://tinyurl.com/yfm9d5b
metalife http://tinyurl.com/yzm3yvw
metaverse exchange http://tinyurl.com/yzh7j4a
slapt http://tinyurl.com/yfqah9u
Jaden Seifert
Registered User
Join date: 4 Nov 2005
Posts: 2
11-07-2005 07:42
thanks for the help!
Polaris Padar
Registered User
Join date: 2 Sep 2005
Posts: 24
11-09-2005 10:49
you could also use llSetForce on the none magnet objects too. this may give you a more realistic magnetic type push on an object, but depends if you have listen scripts on the pushed/pulled objects.