26-07-2021, 04:21 AM
(This post was last modified: 26-07-2021, 06:30 AM by Aolifu.
Edit Reason: Better wording
)
I am trying to add new control points to the Obi Rope in runtime using the same method shown in the docs, so that by using a Linecast line of sight I can identify points which the rope could lay through with enough length, and update that real time as the player moves through the level.
https://gyazo.com/12e11ed1fd2779065ce15c923196efef
This is what happens when I try to add a control point in the middle of the rope, and I cant figure out what in particular is going wrong. Heres the code:
I also can't find in the API of how to change the position of any control Point in runtime, which I think I need to know for the Cursor Mu and ChangeLength to behave correctly.
Any help is appreciated, thanks.
https://gyazo.com/12e11ed1fd2779065ce15c923196efef
This is what happens when I try to add a control point in the middle of the rope, and I cant figure out what in particular is going wrong. Heres the code:
Code:
Vector3 example, tangentLS = new Vector3(0, 0, 0);
example = (startPoint.position + endPoint.position) / 2 + Vector3.up - transform.position;
tangentLS = (endPoint.position - startPoint.position).normalized;
path.InsertControlPoint(1, example, -tangentLS, tangentLS, Vector3.up, 0.1f, 0.1f, 1, 1, Color.white, "test");
path.FlushEvents();
I also can't find in the API of how to change the position of any control Point in runtime, which I think I need to know for the Cursor Mu and ChangeLength to behave correctly.
Any help is appreciated, thanks.