23-01-2020, 04:29 PM
(22-01-2020, 11:17 AM)VincentFTS Wrote: Hi,
I have a rope with both start and end prefabs filled. When I deactivate the rope, the prefabs instances are still viewable whereas they shouldn’t.
Thanks for your help.
Vincent
Hi Vincent,
You can add this code anywhere in ObiRopeBase.cs to fix that:
Code:
public override void OnEnable()
{
base.OnEnable();
if (startPrefabInstance != null)
startPrefabInstance.SetActive(true);
if (endPrefabInstance != null)
endPrefabInstance.SetActive(true);
}
public override void OnDisable()
{
base.OnDisable();
if (startPrefabInstance != null)
startPrefabInstance.SetActive(false);
if (endPrefabInstance != null)
endPrefabInstance.SetActive(false);
}
Let me know how it goes.