Perform action for particular instance of a Sprite

0 favourites
  • 5 posts
From the Asset Store
Alot of High Quality Items sound effects for your game!
  • Hello! Id like to make something like this. If Textbox.Text = Sprite.InstanceVariable, set Sprite Visible. But, I dont understand how to make it so that it only sets the particular instance of the sprite that has its instance variable = Textbox.Text. I can only make it work on all instances of that sprite, not the one in particular that has an instance variable equal to the user input.

    Id really appreciate any help here.

    Regards,

    KreKre

  • Use the System condition "Pick by evaluate".

    • In the object field, choose your Sprite
    • In the evaluate text field, enter Textbox.Text = Sprite.InstanceVariable

    This should get you going.

    If not, please send a screenshot of your Pick condition and I'll figure out what's wrong.

  • You need to pick the correct instance you want the event to take action on by specifying it in the conditions.

    In this case, your condition should be Sprite - compare instance variable - instancevariable = textbox.text.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to pick the correct instance you want the event to take action on by specifying it in the conditions.

    In this case, your condition should be Sprite - compare instance variable - instancevariable = textbox.text.

    Thanks a lot, this was perfect for my intention.

    Im guessing that there is no way to make this non-case sensitive? Its not a massive problem, but it would be a good thing.

  • https://www.scirra.com/manual/126/system-expressions

    [quote:3nyqmvxc]lowercase(text)

    Convert the given text to all lowercase.

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