Help! changing one attribute to another attributes value doesnt work!

RickyRicky Member Posts: 58
edited November -1 in Working with GS (Mac)
when I use the constrain attribute behavior, I fill in game.playerx for the first box, and i fill in self.position.x for the seccond box and it doesnt work! the attribute game.playerx is still 0! how do I fix this>?

Comments

  • vegasmike1vegasmike1 Member Posts: 192
    `constraining an attribute does not really change it, but it can set an attribute to a variable that you have estblished.

    constrain selfx to other attribute value

    or simply change attribute self.x to some other variable that you have already set, which could be any other actors variable.

    So just use change attribute.
    and change it to a variable that you have already set or are setting dynamically
  • RickyRicky Member Posts: 58
    it still doesnt work.
  • RHRH Member Posts: 1,079
    Use change attribute if you want to change it once, use constrain if you want to sync them, i.e. if self.X changes so to will game.X

    You've used constrain correctly, all I can imagine is;

    - you don't actually have an actor with the constrain on in the scene
    - you've constrained the attributes of the wrong actor
    - the actor isn't actually moving (i.e. self.position.X isn't actually changing and it is positioned at 0 on the X axes)

    All seem like stupid suggestions but it's the only way I see that you could be going wrong (unless if, for some reason, your version of GS has a bug in constrain).
Sign In or Register to comment.