Movable Attribute...

ForteForte Member, PRO Posts: 297
edited November -1 in Working with GS (Mac)
Hi everyone,

I have a pause button, and actors, when the pause button is pressed the attribute "Movable" is changed to false. They accelerate upwards, then when the pause button is pressed, (keep note there is no other rule happening except for gravity) they don't stop. They just keep falling.

Why? I have tried making new attributes but still nothing.

Help anyone?

Comments

  • AppChogieAppChogie Member Posts: 503
    Hi Dragokillz you need to constrain the attribute's X and Y after to the position you want them to end up.

    Hope that helps

    Keith :-)
  • ForteForte Member, PRO Posts: 297
    Sorry, I understand X and Y but I'm not entirely sure what I'm supposed to do...
  • AppChogieAppChogie Member Posts: 503
    Add a constrain attribute behavior to the actors that are falling after the pause button is pressed. When you constrain the attribuite to where you want it to go with the X and Y then the game cant move the actor out of those paramaters so they stay put. If you email me via the forum with a screenshot of the code I will have a look for you to make sure.

    Regards

    Keith
  • victorkin11victorkin11 Member Posts: 251
    "Movable" attribute is for edit only, you can't change it in the game!
  • ForteForte Member, PRO Posts: 297
    is it supposed to be

    rule if pause is true

    constrain self x to self x

    " self Y to self Y

    It still falls, I don't think im doing it right...
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    You should store its position in local attributes and then constrain its position to those stored attributes. But you should also give it an acceleration in the opposite direction of gravity because gravity is still affecting the actor and its linear velocity keeps increasing. You actually don't see it happening because your actor is just being redrawn in its position.
Sign In or Register to comment.