john9818a on 26/3/2004 at 20:42
I have an object in my FM. I want to be able to rotate it 90 degrees when a lever is frobbed, and return to 0 when the lever is frobbed to normal position.
I know how to make objects rotate on their own. I've added the rotate and rotatestate properties.
Thanks!!
John
Dark Arrow on 26/3/2004 at 20:46
Adding S>Script:StdLever to the object should do it. Just make sure it doesn't have Engine Features>FrobInfo: Script.
Shadowspawn on 26/3/2004 at 20:53
You could also set it up with a Tweq: Rotate and use the script TweqOnOff. Then you can control it with a lever or button.
Nameless_Voice on 26/3/2004 at 22:26
In more detail:
Add S->Scripts and put in "TweqOnOff"
Add Tweq->Rotate and set it up as follows:
Halt: Stop Tweq
AnimC: Sim
MiscC: [None]
CurveC: [None]
Primary Axis: (This depends on which way you want it to rotate. Lets use Y as an example)
x rate-low-high: 0 0 0
y rate-low-high: 5 0 90
z rate-low-high: 0 0 0
The 'X' box is the speed at which the object rotates, the 'Y' box is the starting rotation (usually only used if you want to rotate anti-clockwise), and the 'Z' box is the final rotation.
Add Tweq->RotateState. Just leaving it blank should work okay.
Link from the lever to the rotating object with a ControlDevice link.
- NV
john9818a on 26/3/2004 at 23:14
Thank you Nameless_Voice, Shadowspawn, and Dark Arrow. I got it to work. :thumb:
John
Mortal Monkey on 27/3/2004 at 00:27
Funny, I've never gotten TweqOnOff to do more than start/stop tweqs. But then again, maybe it's different with subparts.
john9818a on 27/3/2004 at 03:34
Basically that is what it did for me, so I made a conversation to frob the switch, wait for the rotate to finish, and then frob the switch again.
John
Nameless_Voice on 28/3/2004 at 22:36
If you just want the object to rotate straight back to the start position after it's finished rotating the first time, you just need to give it the OneBounce flag for the appropriate joint.
- NV
john9818a on 29/3/2004 at 00:44
The object starts at 90 degrees and is rotated to 0 degrees with one pull of the lever which is what is supposed to happen. I don't want it to go from 90 to 0 and back to 90 because (without spoilers) it wouldn't serve any purpose. Everything you told me with the addition of the conversation makes it work acceptably.
Thanks Nameless_Voice :D
John
trefoilknot on 12/12/2018 at 05:01
Sorry for the necro-- suppose I wanted to rotate an object 90 degrees (in the same direction) each time a button is pushed? With TweqOnOff, the object will just toggle back and forth between a fixed starting angle, and a ending angle. I'd like the ending angle to be the starting angle plus 90--can this be done without much heroics?
Thanks!