15-05-2018, 07:57 PM
If i change the simulation order off of Fixed Update it will snap properly but need it to interact with other physic objects properly.
Any advice?
Help Rope position delay from parent
|
15-05-2018, 07:57 PM
If i change the simulation order off of Fixed Update it will snap properly but need it to interact with other physic objects properly. Any advice?
15-05-2018, 08:02 PM
Hey what software did u use to record the video? When I try using OBS studio the cloth plugin starts bugging out (cloth behaives like a bunch of spiky triangles).
15-05-2018, 08:03 PM
16-05-2018, 12:02 PM
(15-05-2018, 07:57 PM)VirtualCucumber Wrote: Use "After Fixed Update" as your simulation order, if the object is moved using animation. If you're not using animation but procedural movement in Update(), do it in FixedUpdate() instead.
16-05-2018, 01:59 PM
(This post was last modified: 16-05-2018, 02:04 PM by VirtualCucumber.)
(16-05-2018, 12:02 PM)josemendez Wrote: Use "After Fixed Update" as your simulation order, if the object is moved using animation. My movement is in FixedUpdate() Code: public void FixedUpdate() This is my movement, simply using Rigidbody velocity. EDIT: I could easily Translate the object instead, just wanted to keep it simple with a small project.
16-05-2018, 02:11 PM
(This post was last modified: 16-05-2018, 02:53 PM by josemendez.)
(16-05-2018, 01:59 PM)VirtualCucumber Wrote: My movement is in FixedUpdate() In Unity, the order of events is the following: - FixedUpdate (0, 1, or more times) - Animation update - WaitForFixedUpdate (After Fixed Update in Obi) - Update (just once) So if you are moving the object in Fixed Update(), setting the solver update order to "After Late Update" should ensure simulation happens after the object has been translated. Edit: Also, ObiSolver exposes lots of C# events that are called at particular times during the simulation loop. OnStepBegin, OnStepEnd, OnBeforePositionInterpolation,OnFixedParticlesUpdated... etc. You could insert your code in a delegate to be called during OnStepBegin, which is triggered every FixedUpdate just before starting the simulation step. This way you could still use Fixed Update simulation order.
16-05-2018, 04:05 PM
(16-05-2018, 02:11 PM)josemendez Wrote: In Unity, the order of events is the following: I had it simulate after fixed update at first but when i started pinning physics objects to it, the objects would not react. And I would assign that function to the event like this? Code: private void Start()
16-05-2018, 04:32 PM
(This post was last modified: 16-05-2018, 04:32 PM by josemendez.)
(16-05-2018, 04:05 PM)VirtualCucumber Wrote: I had it simulate after fixed update at first but when i started pinning physics objects to it, the objects would not react. Yes, as the rope is being simulated after regular physics, so rigidbodies will ignore the rope. You should use OnStepBegin then, to make sure the order in which things happen each FixedUpdate() is this: - The object moves (your Move() function is called) - The rope is simulated. - Rigidbodies are simulated. (16-05-2018, 04:05 PM)VirtualCucumber Wrote: And I would assign that function to the event like this? Yes, but make sure the function parameters match the delegate parameters.
16-05-2018, 05:06 PM
(16-05-2018, 04:32 PM)josemendez Wrote: Yes, as the rope is being simulated after regular physics, so rigidbodies will ignore the rope. You should use OnStepBegin then, to make sure the order in which things happen each FixedUpdate() is this: Thanks for the info. Sorry for spamming with questions but i havent dealt yet with Delegates and Events. I get the jist of them just havent used them. I cant just have: Code: private void Start() Do i have to declare a delegate in the ObiSolver class and assign its type to OnFrameBegin/End ?
16-05-2018, 05:17 PM
(16-05-2018, 05:06 PM)VirtualCucumber Wrote: Thanks for the info. Yes, you can just have that. I meant that the arguments of your Move() function should be the same ones declared for OnStepBegin, but I see you already did that. |
« Next Oldest | Next Newest »
|