Hodo33 Posted December 4, 2019 Posted December 4, 2019 I have a door with a wheel that turns when you open it. When you close the door it should turn the wheel the other way.%door.setThreadDir(0,true);%door.playthread(0,"Wheel");%door.stopThread(0);%door.setThreadDir(0,false);%door.playthread(0,"Wheel");%door.stopThread(0);This does not work.... seems stopThread resets the seq to frame 0 I changed the anim to not be cyclic and still does not work. What am I doing wrong here? Quote
Azaezel Posted December 4, 2019 Posted December 4, 2019 function smartPlayThread(%obj,%anim,%direction) { if (!isObject(%obj)) return; %obj.inTransition = true; if (%direction) { %obj.stopThread(0); %obj.playThread( 0,%anim ); %obj.setThreadDir(0,true); } else { //play anim backwards %obj.stopThread(0); %obj.playThread( 0, %anim ); %obj.setThreadPosition(0,1); %obj.setThreadDir(0,false); } //while were at it, trip any synced animations for stuff mounted to us %count = %obj.getMountedObjectCount(); for (%i=0; %i<%count; %i++) { smartPlayThread(%obj.getMountedObject(%i),%anim,%direction); } }I use this a lot, personally. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.