What is wrong with this event!?

0 favourites
  • 8 posts
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • I am trying to make it so you select the base by pressing it and then the arrow pops up when its selected, and goes away when you de-select it by pressing it again. I made an instance variable called selected to make it work, please tell me what im doing wrong! Below is a capture of the event.

    dl.dropboxusercontent.com/u/68458825/Capture1.PNG

  • Spawning on layer 0 which is the bottom layer. Might be behind another object.

  • No idea what you are doing wrong, but here is a workaround.

    Pin the Checkmark to the objects you want selectable, when you spawn them.

    At spawn turn the checks invisible.

    On mouse over set it to Visible 50%

    On mouseover and left click, set to visible 100%

    Invert a mouse over the checkmark, and set to invisible.

    TL;DR, Use visibility, and toggle it on and off with clicks rather than trying to spawn one every time you need it.

    If you add the Checkmark to a container, it will automatically destroy with the object it is parented to.

    Hope that helps, my english is not so good.

  • Your second Touch event is triggering after your first on the same touch - so you touch it, the variable changes to 1, then the next event in the line triggers and since Selected is now 1 it fires and destroys the other sprite immediately.

    Try only having one touch event and have sub events to check the instance variable, like so:

    http://storage.wertle.com/construct2/touchIssue1.PNG

    Edit: the Move to Top of Layer thing isn't necessary, I just had it in to make sure it wasn't spawning behind the first sprite (it wasn't)

  • Wertle I tried that and now the arrow will pop up, but wont go away when i click it again :/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • and the main thing I need working is the selecting, the arrow is just for visuals. Only a selected base sends troops so it is huge that I get it working properly!

  • something was wrong with the touch, I made it wait 1/8 of a second before doing anything after the touch and it fixed it. thanks for your help everyone

  • yeah in future you can debug check variables with text objects so that you know for sure they are being set correctly.

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