Help Particle Attachments at runtime - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Help Particle Attachments at runtime (/thread-3073.html) |
Particle Attachments at runtime - fishing-rod - 19-08-2021 Hi, I ran into a problem assigning and removing the targets of particle attachments at runtime. I'm on Obi Rope 6.2 and Unity 2020.3.15f2. I think I got it to work at some point, but I cant figure out the build in my collab history. Whenever I attach something to the rope, i.e. setting the target property, I run this code so that everything sits at the right position: Code: /// <summary> I have a breakpoint at ResetParticles and the funktion is properly executed. The attached GameObjects (hook and equipment) are at their original positions when I pause the editor. The rope particles are not though. I also still see the target properties being set in the inspector. The screenshot is during the pause from code. The two red dots are the attached GameObjects, the line goes right through them in its original state. There is some manual workaround which makes it work: When I de- and reactivate the ObiRope component during the pause and then resume, the particles are back at their original positions. Recreating that in code with Rod.line.gameObject.SetActive() doesn't work though. Am I approaching this in the wrong way? RE: Particle Attachments at runtime - fishing-rod - 19-08-2021 I got it to work when adding Code: Rod.lineObj.GetComponent<ObiRope>().enabled = false; as the very last lines in the function. |