Larian Studios
Posted By: Daddy Bowser Rotating an Object By Scripting - 21/01/18 11:03 PM
I tried looking for preexisting scripts that rotated an object but I couldn't seem to find any. I remembered the particular statue on Reaper's Coast in the Graveyard that would rotate at about 45 degree angles after each time you selected that dialog option, but I couldn't figure out how the statue was actually turned. I'm kind of new to scripting, I saw there was a GetRotation event you could use for an item but nothing about setting or changing it's rotation, unless I'm missing something obvious. Any ideas or suggestions?

Posted By: LarIlya Re: Rotating an Object By Scripting - 22/01/18 12:25 PM
You can use ItemRotateY and ItemRotateToAngleY in Story to rotate objects.

There's a Y because the item is rotated around the Y axis (the vertical one).
Posted By: Daddy Bowser Re: Rotating an Object By Scripting - 25/01/18 06:06 AM
Thanks for the response! I actually haven't even touched the Story scripting yet. I managed to find how they did the statue quest since I knew where to look now, but I haven't been able to figure out how to make an object turn automatically at a constant rate, or at least on some kind of pressure plate toggle instead of through a dialogue option. My only experience so far with scripting has been door switches and fireball traps lol.
Posted By: BloodyWorth Re: Rotating an Object By Scripting - 28/01/18 08:57 PM
If you use the rotate call, the item will automatically lerp("animate") the rotation, so it will be smooth, if you want it just to be instant you can use ItemToTransform
© Larian Studios forums