Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FixedUpdater location affecting rigidbody interaction
#1
I have a rope and a player-controlled character. I want the rope to act as a barrier. If i put my updater and Solver on the rope itself, the rope works, and the character can't penetrate the rope. If i put the updater/solverĀ at a higher level so that i only have one updater in the scene, the character can walk right through the rope.

Am i missing something as far as how this should work? I thought i could have one solver and one updater in my scene, as long as my solver was listed in my updater and all obi objects were children of the solver.

Attached two images of it working vs it not working (player can penetrate)


Attached Files
.png   working.png (Size: 29.96 KB / Downloads: 11)
.png   NotWorking.png (Size: 23.36 KB / Downloads: 11)
Reply
#2
(24-08-2022, 11:35 PM)nghillaz Wrote: I have a rope and a player-controlled character. I want the rope to act as a barrier. If i put my updater and Solver on the rope itself, the rope works, and the character can't penetrate the rope. If i put the updater/solverĀ at a higher level so that i only have one updater in the scene, the character can walk right through the rope.

Hi!

Simulation is always performed in the solver's local space. Placing the solver on the rope itself doesn't make any sense, since you'd be simulating a rope in its own local space - which is moving with the rope - so results can be unpredictable.

Depending on when your solver is updated during the frame (fixed update, after fixed update, late update, or some other place) and when your character controller is updated, you can have a 1-frame delay between them that will cause the character to penetrate the rope. So the solver takes care of where your simulation takes place, and the updater takes care of when.

A typical setup for small scenes that want simulation to be done in world space is to have a single solver in a root object placed at 0,0,0, with all actors as children (at any nesting level). In this case you can pretty much forget about the solver and assume everything is simulated in world space.

Could you give more details regarding your setup?
- Where's the solver placed in the hierarchy?
- Are you using a FixedUpdater or some other updater?
- How does your character controller work?

kind regards,
Reply
#3
Ah thank you that is so helpful!

I moved my character controller movement from fixed update to a coroutine where i could make sure it happens after rope calculations. I now have just one updater and one solver in the root, and everything works perfectly!
Reply