Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  [ObiRope 4.1] Start and end prefabs are not deactivated when a rope is.
#2
(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.
Reply


Messages In This Thread
RE: [ObiRope 4.1] Start and end prefabs are not deactivated when a rope is. - by josemendez - 23-01-2020, 04:29 PM