Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tear Rod
#1
Hi,

I send this post because there is no out-of-box support for tear rod and I need this in my game dev. By looking at Obi source code I finally implemented a close one. Though it's more like a "fold rod" and mesh is not split, it's ok for my game's requirement. I hope this can help you if you have similar requirement. It's based on Obi Rope 7.0.5

Also I'd like to ask why this feature is not supported in case I missed something important and my code may fail to work in future Obi version. 

My code is actually very simple, just deactivate a constraint:

 public void TearRod()
    {
        ObiRod rod = fishingRod;
        var twistBatch = rod.GetConstraintsByType(Oni.ConstraintType.BendTwistas ObiBendTwistConstraintsData;
        foreach (ObiBendTwistConstraintsBatch batch in twistBatch.batches)
        {
            if (batch != null)
            {
                batch.DeactivateConstraint(0);
            }
        }
        rod.SetConstraintsDirty(Oni.ConstraintType.BendTwist);
     
    }


Effect gif: p1.gif
Reply


Messages In This Thread
Tear Rod - by chenji - 17-06-2025, 05:47 PM
RE: Tear Rod - by josemendez - 18-06-2025, 08:10 AM
RE: Tear Rod - by chenji - 18-06-2025, 08:34 AM