Problem with Set Text

  • Hi,

    I'm doing the BobblePop tutorial in LevelZero and I'm having a problem with Set Text actions.

    I'm supposed to create two actions, one for Score and one for Lives. So I do the one for

    Score and the action reads Set text to "Score:" &Score, and it works when I run the game.

    Then when I try to set up the Set Text action for Lives, I get to the box for Parameters for

    Lives: Set text. I put in "Lives:" &Lives. The Objects with Expressions box starts flashing,

    and on the Parameters box I get the message, 'Lives needs an expression after it. Lives is

    an expression name and you need a dot and an expression name after it.' What's my problem

    here?

    Thanks,

    Willow

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Did you name your text object "lives"?

    I'm assuming "lives" should be a variable, or that you haven't set up the "lives" variable yet.

  • There is indeed an object named 'Lives'.

  • You can have a variable and object named the same. If you reference the object, it will ask for a "." and parameters in the expression. If you reference the variable, it can stand as is. When typing in "lives", make sure you pick the one that is the variable.

    Edit: As a best practice - never name two things the same thing. So use LivesText, or LivesVariable instead if necessary for example.

  • Ha ! oosyrag now that is clear, where was you when i did exactly that thing ?

  • Thanks oosyrag, I had NOT set up a "Lives" variable and that did the trick.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)