Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Runtime Rope Generation
#1
First off this all works fine if generated in editor beforehand. If I create a rope and hit play it works just fine with my procedurally generated Obi Colliders.

However if I generate my rope at runtime there seems to be no recognition of the Obi Colliders.

The way I have generated the ropes is basically like so, I pretty much copied the documentation from the website. What am I missing to get them to partake in the physics system?

Code:
    var blueprint = ScriptableObject.CreateInstance<ObiRopeBlueprint>();
    blueprint.path.Clear();
    //for each point in the navmesh path generated
    blueprint.path.AddControlPoint(relativePosition, pointHandleIn, pointHandleOut, pointNormal, .1f, .1f, 1, 1, Color.white, i.ToString());
    
    blueprint.path.FlushEvents();
    blueprint.GenerateImmediate();
    var ropeRenderer = connectedWire.GetComponent<ObiRopeExtrudedRenderer>();
    var rope = g.GetComponent<ObiRope>();
    ropeRenderer.section = Resources.Load<ObiRopeSection>("DefaultRopeSection");
    rope.ropeBlueprint = ScriptableObject.Instantiate(blueprint);
    rope.transform.SetParent(solverParent.transform, true);

Thanks
Reply


Messages In This Thread
Runtime Rope Generation - by mnholbart - 04-12-2021, 09:54 AM
RE: Runtime Rope Generation - by josemendez - 06-12-2021, 10:32 AM
RE: Runtime Rope Generation - by mnholbart - 06-12-2021, 09:01 PM
RE: Runtime Rope Generation - by Reydans - 07-12-2021, 10:35 AM