0 Favourites

Help with "Pick Object With Highest Variable"

This forum is currently in read-only mode.
  • I need some help with the "Pick Object With Highest Variable" action. I made a simple cap with three instances of a sprite object. The objects each have a private variable called cSpeed, set to 1, 2 and 3 respectively. Then, during the startup, I call "Pick Object With Highest Variable" and tell it too look at the objects' speeds. Then I set a text object to the cSpeed of the object that was selected.

    It seems like it should be simple enough, but nothing happens. The text field never changes. If I put a message box action after the "Pick Object With Highest Variable" condition, it never fires. I feel like I'm missing something here.

    Pick Object With Highest Variable Cap

    Thanks for the help

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • They all have 'destroy on startup' attribute ticked.

  • They all have 'destroy on startup' attribute ticked.

    Ah yes, yes...... so sorry for that..... That one little box makes a big difference apparently. Thanks for taking the time to check out the file and for the response.

    Now things work pretty well when I start the cap with three character objects created at startup. However, when I spawn the characters as we've learned about in the platform tutorial, things don't go so well. At runtime, I create three character objects and assign them cSpeeds of 1,2 and 3 and I can see that each character has the correct cSpeed, but the "Pick Object With Highest Variable" action picks the character with cSpeed = 1.

    Static and Spawning Characters

  • It works if you do it on any other tick than the start of layout one.

    I think this is a bug, so submit it to the tracker .

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
157 12,704
megatronx's avatar
megatronx
Unread hot topic
167 14,517
DMT2005's avatar
DMT2005
Unread hot topic
0 Favourites
Kiira will help! :D
132 16,625
Kiira's avatar
Kiira