#Is there a way to change text when another component changes

11 messages · Page 1 of 1 (latest)

left reef
#

I'm trying to change the pricing when the size changes and if it's a subscription or one time selected.

  • if 5lbs is selected and subscription is selected then price is 17.55
  • if 5lbs is selected and one time purchase is selected then price is 20.18
    and so on for the other sizes as well.

I know variables and conditionals are new so I think this might use that? if there's a way would love some suggestions! Thank you!

verbal nova
#

Hey @left reef ! Yeah variables and conditions would definitely help!

You can have a boolean variable maybe called is5 that is false, and another boolean variable called isSubscription that is also false. And a number variable called price that is 17.55 (or whatever you want it to be in the beginning). (Maybe the other variables should also be different based on what the initial state would be)

#

Then whwn clicking on 5lbs you can have an interaction that:

  1. Set variable: is5 to true. Ans then conditional: if is5 true and isSubscription true then set variable price to 17.55
#

You can make similar once for when clicking subscription or one time or any of the other lbs

#

(But ofc updating things to the corrext state)

left reef
#

Thanks @verbal nova ! I'll give it a try

verbal nova
#

Oh and u also wanna connext the price text to the price variable

#

So click on the text layer for the price and there should be a little token appearing if you hover around the part where u would modify the texts size and stuff

#

And then click on that and then select price

#

And then it should be connected. Basically it will display whatever the price is

left reef
#

Got it to work! Thanks again! hello