Obi rope ends - 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: Obi rope ends (/thread-156.html) |
Obi rope ends - Parker - 25-09-2017 How can we get the rope end/start prefab and change Color or material during runtime. When you attach a start and/or end prefab to the rope startprefab or the endprfab. We want to change material on the ends how can we get a handle or reference to the instantiated end RE: Obi rope ends - josemendez - 26-09-2017 (25-09-2017, 11:01 PM)Parker Wrote: How can we get the rope end/start prefab and change Color or material during runtime. Hi! You can use any of the GetComponent() family of GameObject functions to find the rope ends by component type. If your goal is just to change their color, a good approach would be to write a component that does this and add it to the prefab. This way the ends would change their own color themselves and you probably would not need to access them from the outside. If you really need direct access to them, in ObiRope.cs you can find both as private variables around line 162: Code: private GameObject startPrefabInstance; You can just make them public to access them from the outside. |