How do I move an object to a specific UID?

0 favourites
  • 10 posts
From the Asset Store
Act on your instances, get/set their properties and variables only thanks to their UID. No more picking trouble! Plugin
  • Hi Everyone,

    I'm creating a game where the player selects 2 objects (a gatherer and then a townhall) and then they "linked" by assigning the townhall's UID to a variable in gatherer.

    Gatherer will then spawn a delivery object and pass on the townhall UID to into a variable in delivery.

    This is all happening just fine. I have verified the delivery variable is correctly set to the townhall's UID. However, I can't get the delivery object to then more towards the townhall with that UID.

    I have tried using the "Pick instance with UID" event but it isn't triggering any of it's actions. I've searched the web and I see people having issues with using this event but no solutions I can find.

    Am I doing something wrong or is there an easier way to deal with this?

  • The pick instance condition needs to be the town hall object instead of deliver object.

  • So that event wouldn't help with my conundrum then?

  • I'm saying it's correct except you have the wrong object selected, change it to the other one as I mentioned and it's fixed

  • Ok, I made that change and nothing is happening.

  • Let's see the action where you set the delivery variable. It can be just a timing thing. I have some concern because this is an 'on created' event and you didn't set the variable yet.

  • Here you go:

  • Hmm the logic seems reasonable. Maybe because you have them in different event sheets so they are not being read ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    On created you cannot access the instance variable directly.

    You need to set "Wait for previous actions to complete" after creation

    then do the pick via the instance variable.

  • I actually took it out of the on created loop and it does work now. Thanks all for the assistance.

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