ink icon indicating copy to clipboard operation
ink copied to clipboard

how to make a knot like a trigger in unity

Open marianaloa opened this issue 3 years ago • 1 comments

Hi! im trying to have something like if(knotName = “Final1”) { button.gameObject.SetActive(true) } else { button2.gameObject.SetActive(true) }

idk if it’s possible that depending on the knot you are in it’s going to let me appear those buttons

i think my question is how do i call the knot to do that

marianaloa avatar Mar 17 '22 05:03 marianaloa

There must be a way to get the knotName, but I think you don't want this in fact.

  1. Most easy would be to have it as a parsing element In your ink
>>>ChangeState: button2

and in your reader, you don't display if that's beginning with >>> but instead you do whatever you want.

It's based on: https://github.com/inkle/ink/blob/master/Documentation/RunningYourInk.md#alternatives-to-external-functions and trying to have all the logic at one place, not multiple (your code, your ink)

You can totally use ink to dictate how to run your game, you can also do the other way and totally dictate your ink. For me, it seems you are trying to do something in the middle.

If your particular case don't work, don't hesitate to share more of the settings, because it's very abstract right now.

Selsynn avatar Mar 17 '22 15:03 Selsynn