simple instance variable question

0 favourites
  • 3 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi, guys, me again. posting another noob question, sorry I just exploring array and instance variable and continuously having several questions.

    How do I set text of a text object by referring its instance variable?

    I tried to compare it by its instance variable but not working.

  • I'm not sure really what you are trying to do but maybe this will help.

    First, given the image, your events aren't going to choose a specific text object. You are using the system compare 2 variables event. This will trigger if it finds a value that matches but no object is selected so you don't know which object the system will choose. Most likely it will be all text objects.

    Instead, you should use a text event and compare it's variable. This is what your events would change to:

    Also, you can cut down your events simply by using the instance variable as the array index.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure really what you are trying to do but maybe this will help.

    First, given the image, your events aren't going to choose a specific text object. You are using the system compare 2 variables event. This will trigger if it finds a value that matches but no object is selected so you don't know which object the system will choose. Most likely it will be all text objects.

    Instead, you should use a text event and compare it's variable. This is what your events would change to:

    Also, you can cut down your events simply by using the instance variable as the array index.

    WOW! This is what I wanted. Now I understand it. Thanks, you are awesome. :D

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