Hey feel free to send me to other places to do more reading. Or re-reading. I may have missed the answer elsewhere! But I have been struggling for a week now.
I have a similar goal to the user in this thread although I'm not getting a flat crash. Sometimes I get a performance bog down and THEN crash... Anyway.
TL;DR I am simply trying to spawn a rope from a prefab, in precise position, but it keeps tearing.
The Problem, longer version:
Anyway. I do think part of the problem is that I transform the ends of the rope in just a couple frames. I mean, I have to do this because I want the rope to spawn apparently instantaneously. Unfortunately right now I do this: (a) Spawn the rope in approximately the right space, but then (b) Quickly teleport the edges into position, and then the rope TEARS every time.
So...
2. Second Question: Suppose I'm doing everything else right. But my rope is indeed being torn by the act of transforming the blocks to which its ends are constrained... is there another way to get each end immediately into their proper position? For that matter, I may need to iterate through each particle and specify its location - so the whole thing is in position... Is that it?
PS.
If you can see the picture attached, that might help. Note that the final position of the rope might mean using the ObiCursor real quick too. Because the desired length might be longer or shorter. But again, getting the correct length has not been much of a problem for me.
Any help would be appreciated.
I have a similar goal to the user in this thread although I'm not getting a flat crash. Sometimes I get a performance bog down and THEN crash... Anyway.
TL;DR I am simply trying to spawn a rope from a prefab, in precise position, but it keeps tearing.
The Problem, longer version:
- I have prefab of a rope just the way I like it. Would rather not generate the rope from code (using the stuff in the Helper script). Anyway, it is in a gameobject with its own solver.
- And most importantly, this prefab rope has two gameobject children: call them BlockA and BlockB. These blocks represent the start and end of the rope. Each particle tip of the rope is constrained to their blocks. So far so straightforward.
- The idea is... tie TWO objects together easily. By attaching / childing the blocks to those objects. I can use the ObiCursor to changelength no problem.
- In other words... I aim to create a function that accepts two vector3 positions and then creates an appropriately sized rope between them. Or in other words again, imagine two objects floating around, but then when the user presses SPACEBAR the two objects have the prefab rope spawned between them, each with a Block childed' to it.
- First question: What do I need to watch out for? Surely connecting two objects at runtime is a somewhat common application of Obi Rope.
Anyway. I do think part of the problem is that I transform the ends of the rope in just a couple frames. I mean, I have to do this because I want the rope to spawn apparently instantaneously. Unfortunately right now I do this: (a) Spawn the rope in approximately the right space, but then (b) Quickly teleport the edges into position, and then the rope TEARS every time.
So...
2. Second Question: Suppose I'm doing everything else right. But my rope is indeed being torn by the act of transforming the blocks to which its ends are constrained... is there another way to get each end immediately into their proper position? For that matter, I may need to iterate through each particle and specify its location - so the whole thing is in position... Is that it?
PS.
If you can see the picture attached, that might help. Note that the final position of the rope might mean using the ObiCursor real quick too. Because the desired length might be longer or shorter. But again, getting the correct length has not been much of a problem for me.
Any help would be appreciated.