25-07-2024, 04:27 PM
(This post was last modified: 25-07-2024, 04:31 PM by josemendez.)
(25-07-2024, 03:07 PM)Ferhat123 Wrote: Hi,
I want to attach gameobjects to the ends of both ropes after tearing them apart. I want to do this every time I tear up any rope.
I guess I can't add control points at runtime to attach these gameobjects, so maybe the solution is to generate two separate ropes at runtime when I cut the original rope.
How can I do it?
Thank you,
Hi!
Attachments take a particle group (not a control point) as argument, and you can create particle groups at runtime just fine. See:
https://obi.virtualmethodstudio.com/manu...ments.html
So you can just get both particles involved in a tear operation, create one particle group for each and attach them.
Also note that using attachments in this way only makes sense if you’re attaching rigidbodies and you need two-way coupling with the rope, if you just want to set the position of a gameObject to follow the cut ends you can do so like the ElectricWires sample scene does.
Let me know if you need further help,
Kind regards