Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Instantiate new rope on tear
#2
(06-09-2017, 02:55 PM)niZmo Wrote: Like the title says I'd like to make a new rope object out of the torn ropes pieces. For what I need to do, I cannot have two pieces of a rope as the same gameObject. I was thinking of using the ObiRopeCursor. I could get the particle where the rope is torn, init a new prefab based of the length of the original rope minus the tear particle index and use the cursor to set the new and the old ropes lengths. Works in theory. Is this the way to go about it or is there an easier way? It would be a nice API addition for obi rope, a little bool parameter under the Tearable param Guiño .

Hi Nizmo!  Sonrisa

Why do you need each rope piece to be its own GameObject? remember that the GameObject transform is not affected by the movement of rope particles in any way, so the only benefit you'd get from it is...well, another GameObject.

ObiRopeCursors can make individual rope segments (created by cutting a rope) grow or shrink when positioned at the appropriate place in the rope, so having separate GameObjects for this purpose isn't necessary.

Also having a GameObject per rope piece could spawn lots of them in the worst case (exactly as many GameObjects as particles your original rope had, minus one), hindering performance. Honestly I cannot think of a single advantage or potential use case for this method, that's why I'm curious as to why you need it.
Reply


Messages In This Thread
Instantiate new rope on tear - by niZmo - 06-09-2017, 02:55 PM
RE: Instantiate new rope on tear - by josemendez - 06-09-2017, 08:30 PM
RE: Instantiate new rope on tear - by niZmo - 06-09-2017, 10:42 PM
RE: Instantiate new rope on tear - by josemendez - 07-09-2017, 10:54 AM
RE: Instantiate new rope on tear - by niZmo - 07-09-2017, 02:14 PM