How do I make a pause without using Wait?

0 favourites
  • 8 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Hi everybody, my problem lies in the fact that I've made a Family, which is basically making a sprite visible, but if I create the family and then set the family scale to say 2, the scaling doesn't work, the only way I can get it to work is to make a wait time of 0.001 seconds between creating the family and scaling the family for the scaling to take effect. Unfortunately this leaves a single frame where the family is scaled wrong and it's glaringly obvious.

    https://imgur.com/PX1LbVY

    Any workaround to this? I've tried putting the scale family as a sub-event to make a break without using the Wait, but it doesn't work, I can only get the scaling to work when I use a Wait event in between.

  • Why do you need a pause? Why isn't the scale working? Try on family created > set scale.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why do you need a pause? Why isn't the scale working? Try on family created > set scale.

    I'm not sure, it won't let me reposition the family or rescale it unless I leave a gap of some kind, it just defaults to the normal one. And I want to be able to change the scale on the fly in the same event sheet, so making a "on family created" for every scenario would be hell.

    There must be some easy way to change a family's properties after creation without some kind of break for the code to register it?

  • [quote:2qud8d8h]There must be some easy way to change a family's properties after creation without some kind of break for the code to register it?

    It's on family created. What do you mean by 'every scenario'? This one event covers every creation scenario.

  • [quote:eygdpm07]There must be some easy way to change a family's properties after creation without some kind of break for the code to register it?

    It's on family created. What do you mean by 'every scenario'? This one event covers every creation scenario.

    So if I use On Family Created> set position to X, then every time I create the family, it will be at that position. But I want to be able to change the position, it won't always be X, it will vary every time I create the family, I want that control. I'm finding it very hard to explain.

    Let me put it another way, I've got a set of sprites that are all individual parts, but are parts of the same object, how would you go about spawning that object, along with all the parts in the right positions, and then scaling and positioning that object in its entirety once it's created? As you can see on that image, I made a function that creates all the individual parts and scales them. But if I call that function and then try and re-position it without a Wait in between the calling and re-positioning, it just stays in the original position.

    So if I did On Family Created > set at this position, every time I create it it's going to be there, when in reality I want to be able to change the position afterwards to whatever I want, not just the same one every time it's created. Hopefully this somewhat makes sense.

  • You didn't mention anything about setting a position, you said you had an issue where set scale wasnt working. You can have an event on family created > set scale to x. For the position, you could use a function and pass a parameter through it for location. For your game it sounds like you need to use a container though, where you create an object made up of smaller objects that is premade.

  • You didn't mention anything about setting a position, you said you had an issue where set scale wasnt working. You can have an event on family created > set scale to x. For the position, you could use a function and pass a parameter through it for location. For your game it sounds like you need to use a container though, where you create an object made up of smaller objects that is premade.

    You know, I've just done a different method, where upon Creating an object, it creates another object. But, again, that secondary object's animation cannot be changed unless there's a wait before! I have no idea why this is happening on such a large scale on my project now, I literally have no idea what to do because if I create anything it needs a Wait before anything is repositioned, changed size, changed animation etc...

  • How do you change that second object animation? Sprite->set animation or Family->Set animation?

    When you create a sprite which is part of a family, you can't immediately refer to the Family in the same event if you want to change anything about this sprite. I think it's because this sprite hasn't actually been added to the family yet.

    You need to wait a tick or use "On Family Created" event.

    The problem with using "On Family Created" is that you can't pass any parameters to it (obviously), so here is a workaround. You can pass parameters to a function, where you pick family member by UID and then do whatever you want with it:

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