Hey,
I'm wondering if there is a way to animate two objects in one room at the same time. I have two object animations that work fine by themselves and when played one after the other, but I'd like them to play at the same time, is this possible? I realize this probably is a really basic scripting question.
Thanks in advance for any help! :)
Heya there TheEyess, maybe something like:
function room_Load() {
Object[1].Animate(0, eOnce, eNoBlock);
Object[2].Animate(0, eOnce, eNoBlock);
}
After Object[1].Animate(the loop you want to play. Then if you want it to play once or repeated. Then if it blocks other interactions or not.
Also you may need to set each objects view for which animation they play or the loop within the same view.
exp
Object[1].SetView(1);
Edited: To allow two objects to run without blocking
Playing 2 animations at the same time would require to call the first Animate with eNoBlock.
// replace with your real object names and view names
oFirstObject.SetView(VANIMATION1);
oAnotherObject.SetView(VANIMATION2);
oFirstObject.Animate(0, eOnce, eNoBlock);
oAnotherObject.Animate(0, eOnce, eBlock);
This will schedule first animation and immediately continue to the next command.
I do recommend using scriptnames for objects and views instead of their indexes, as that's safer and less prone to errors.
Hey Crimson, always the helping hand <3
Wouldn't it be oFirstObject rather than cFirstObject
Quote from: Pax Animo on Wed 18/10/2023 00:15:59Wouldn't it be oFirstObject rather than cFirstObject
Right, fixed.
Quote from: Crimson Wizard on Wed 18/10/2023 00:03:01Playing 2 animations at the same time would require to call the first Animate with eNoBlock.
// replace with your real object names and view names
oFirstObject.SetView(VANIMATION1);
oAnotherObject.SetView(VANIMATION2);
oFirstObject.Animate(0, eOnce, eNoBlock);
oAnotherObject.Animate(0, eOnce, eBlock);
This will schedule first animation and immediately continue to the next command.
I do recommend using scriptnames for objects and views instead of their indexes, as that's safer and less prone to errors.
Thank you both! The eNoBlock option was the thing i was missing, thank you so much, Crimson! Working as intended now :)