Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotate w/ Avatar

Fob Mathy
Registered User
Join date: 28 Jun 2007
Posts: 1
06-28-2007 22:27
hey. I am new to this game and have no experience scripting anything. I just started and I need a little help. I want to rotate an object in the direction i turn my avatar. I tried messing around with some of the rotating functions amd the control events but the best i could get was the object constantly spinning. any suggestions would be cool thanks.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
06-29-2007 04:35
From: Fob Mathy
hey. I am new to this game and have no experience scripting anything. I just started and I need a little help. I want to rotate an object in the direction i turn my avatar. I tried messing around with some of the rotating functions amd the control events but the best i could get was the object constantly spinning. any suggestions would be cool thanks.

Assuming the scripted object isn't going to be an attachment (which would automatically make it rotate with whatever body part it's attached to), it will need to find the avatar's rotation. One way it might do this is with an llSensorRepeat("", llGetOwner(), AGENT, floatRange, floatArc, floatRate), and then, in the sensor() event, llSetRot() to be some function of llDetectedRot(0) to make it "face" the same way as the object's owner. If it's to be a physical object, llRotLookAt() may substitute for llSetRot().