Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Some questions & requests
#1
Hi! I've bought Obi Rope some years ago but only now I'm getting my hands on it, and I’m having some issues. I will list them below.

  1. How to set rope start and end position?
    I’m spawning ropes at runtime and I felt like the documentation and tutorials are missing some examples on this.
    What I was trying to do is to link the rope in two dynamic objects that has physics. So the attachment works but the rope is misplaced. I can’t figure out how to set the initial position of the rope’s start and end reliably. Here's the code:

    public void Connect(Transform origin, Transform end)

        _attachment1.target = origin;
        _attachment2.target = end;
    }

    public void SetStartPosition(Vector3 position)
    {
        int firstParticle = _rope.elements[0].particle1;
        _rope.solver.positions[firstParticle] = position;
    }

    public void SetLastPosition(Vector3 position)
    {
        int lastParticle = _rope.elements[^1].particle2;
        _rope.solver.positions[lastParticle] = position;
    }

    So basically, I'm spawning a rope inside an existing Solver in the Scene, calling "SetStartPosition", "SetLastPosition" and "Connect" in sequence. It seems to work only right after spawning. If I need to change the link to some other object I can't set the position again it seems.

  2. Rope is too stretchy. How to handle that?
    I don’t want my rope to stretch too much when moving my objects. I saw in the docs that I can increase the amount of substeps in the fixed updater, or decrease Unity’s fixed timestep, but I don’t think I had good results. What am I missing?

  3. How to reset Rope to it’s rest position?
    When I assign the rope to a new position (and when it works, see 1.) it seems to come with the motion from its original position, starting with a lot of movement already, and I don’t want that. How to stop the rope’s forces and return it to the rest state?
    Tried this but didn't get good results:

    private void StopRope()
    {
        foreach (int solverIndex in _rope.solverIndices)
        {
            _rope.solver.velocities[solverIndex] = Vector4.zero;
            _rope.solver.externalForces[solverIndex] = Vector4.zero;
        }
    }

  4. Is it possible to make it influenced by Time.timeScale?
    My game is changing Time.timeScale sometimes, but it doesn’t seem to affect ropes. There is a workaround?

  5. ArgumentOutOfRange ObiRopeCursor.cs:169
    I get this error sometimes when changing ropes length at runtime.
I think that's it for now. Any help is much appreciated.
Thanks!
Reply


Messages In This Thread
Some questions & requests - by landosilva - 04-08-2022, 10:58 PM
RE: Some questions & requests - by josemendez - 05-08-2022, 07:57 AM
RE: Some questions & requests - by landosilva - 05-08-2022, 03:34 PM
RE: Some questions & requests - by josemendez - 05-08-2022, 04:17 PM
RE: Some questions & requests - by landosilva - 06-08-2022, 02:59 PM
RE: Some questions & requests - by josemendez - 08-08-2022, 07:44 AM
RE: Some questions & requests - by landosilva - 08-08-2022, 09:46 AM
RE: Some questions & requests - by josemendez - 08-08-2022, 10:54 AM
RE: Some questions & requests - by landosilva - 08-08-2022, 02:09 PM
RE: Some questions & requests - by josemendez - 08-08-2022, 02:24 PM
RE: Some questions & requests - by landosilva - 08-08-2022, 02:56 PM
RE: Some questions & requests - by josemendez - 08-08-2022, 03:21 PM
RE: Some questions & requests - by landosilva - 08-08-2022, 03:44 PM
RE: Some questions & requests - by josemendez - 08-08-2022, 03:46 PM
RE: Some questions & requests - by landosilva - 09-08-2022, 04:51 PM
RE: Some questions & requests - by josemendez - 10-08-2022, 07:18 AM
RE: Some questions & requests - by landosilva - 10-08-2022, 10:03 AM
RE: Some questions & requests - by josemendez - 10-08-2022, 10:15 AM
RE: Some questions & requests - by josemendez - 10-08-2022, 10:39 AM