![]() |
Help Rope jiggle after sudden animation position change of handle constraints - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Help Rope jiggle after sudden animation position change of handle constraints (/thread-1335.html) |
Rope jiggle after sudden animation position change of handle constraints - pixhellmann - 28-08-2019 I have an animated device which has a rope between two animated elements. I used the Handle constraint setup on the first and last particle. (works very nicely) We have many timelines driving this devices animations. The issue is, that the elements jump positions between the timelines. So the rope suddenly gets a new position and of course it jumps like crazy to settle down. (impressively robust though!) I have several ideas to workaround this:
I am not a coder but we have some here in the office (but they are extremely busy right now, so as soon as I know which way is possible, I would bother them with that issue ![]() If you need more clarification please let me know. I can upload a video and share it via PM (since it cant be shown publicly) Thank you very much! Best, Philipp RE: Rope jiggle after sudden animation position change of handle constraints - josemendez - 29-08-2019 (28-08-2019, 11:38 AM)pixhellmann Wrote: I have an animated device which has a rope between two animated elements. Hi there! You need to write a little bit of code for this. When "teleporting" the rope (which is essentially what the timeline is doing), you need to deactivate the rope right before the timeline jumps to a new playback position, and re-activate it after the first FixedUpdate() after the timeline has jumped (you can use WaitForFixedUpdate for this). This ensures the rope does not feel the abrupt change in position. In Obi/SampleScenes/SampleResources/Scripts/ObiActorTeleport.cs you have an example of this, that will teleport any actor to a random position inside a sphere when you press any key. Pasting it here for convenience: Code: using System.Collections; RE: Rope jiggle after sudden animation position change of handle constraints - pixhellmann - 29-08-2019 (29-08-2019, 08:02 AM)josemendez Wrote: Hi there! Great, thanks. But this assumes that the rope is not changing its initial form, is it? In our case the rope needs to have different starting poses. sometimes the elements are very far away, sometimes close to each other. Is it possible to feed different restposes per timeline to the rope? RE: Rope jiggle after sudden animation position change of handle constraints - josemendez - 29-08-2019 (29-08-2019, 08:57 AM)pixhellmann Wrote: Great, thanks. Hi, Obi only stores one rest state per rope. If you need to reset the rope state every time a timeline restarts, you will have to write a custom system to store your own rest per-particle positions and velocities per each timeline, and set them when the timeline starts playback. Check out the particle API reference to learn how to get/set particle properties: http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html |