Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  grabbing rope and holding on to it
#2
Hi!

So this is more a question about physics and rigidbodies in general than it is about Obi.

The Rigidbody component in Unity endows an object with physical properties (velocity, mass, etc)  and drives it using physics. Attaching a rope to a rigidbody using a dynamic attachment enables two-way coupling between them, that is: the rope is able to apply forces to the rigidbody, and the rigidbody is in turn able to apply forces to the rope.

So as long as your player is moved around in a physically consistent way it should all just work. By "physically consistent" I mean modifying its velocity somehow, for instance by adding forces or impulses. If you set its transform position directly, you're entirely bypassing physics simulation and as a result the player will ignore any forces applied by the rope allowing him to stretch the rope indefinitely.

I'm fairly sure that Unity's built-in XR locomotion uses no physics/rigidbodies but a CharacterController, so it will ignore physics entirely: https://docs.unity3d.com/Packages/com.un...based.html
https://www.youtube.com/watch?v=4WiMogkep1U

As stated in Unity's manual:
https://docs.unity3d.com/ScriptReference...oller.html

Quote:A CharacterController allows you to easily do movement constrained by collisions without having to deal with a rigidbody.
A CharacterController is not affected by forces and will only move when you call the Move function. It will then carry out the movement but be constrained by collisions.

If that's the case, you'll need to find a physics-based locomotion method that can be affected by forces. This is necessary not just for rope interaction, but to allow the player to be affected by any external forces other than just static collision geometry.

kind regards,
Reply


Messages In This Thread
grabbing rope and holding on to it - by lbouis - 29-06-2023, 01:42 AM
RE: grabbing rope and holding on to it - by josemendez - 29-06-2023, 06:23 AM