Moving actors just does not work

PBEmpirePBEmpire Member Posts: 676
Not sure if my coding is wrong or something but here is my rule

When attribute game.pause=1,
Interpolate self.position.x to self.position.x-1024

I am doing this because i am doing a sliding menu, and the menu has all the stats in it, like coins collected etc, and i am using custom fonts, which is why i have a lot of '0' actors. When the pause button is pressed, i want the menu to slide out, along with the numbers. So i used the rule above to reduce the hassle of editing each individual actor and type the the desired position. But what i am seeing is that these numbers just fly across the scene..

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It doesn't work to interpolate an attribute to an expression including that attribute. Instead, you'll need to interpolate to a different attribute as follows:

    Change Attribute self.startX to self.position.X
    Interpolate self.position.X to self.startX-1024

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • PBEmpirePBEmpire Member Posts: 676
    @tatiang it just glitches out.

    Is there anything wrong with my code?

    When game.menu press = 1,
    Interpolate self.position.x to self.Start X - 1024
    When game.menu press = 0,
    Interpolate self.position.x to self.Start X + 1024

    Some really weird things happen. The errors are just not consistent.. Sometimes the first round works. Sometimes the numbers just dont appear while some other time only 1 or 2 of the 4 number actors appear..


  • PBEmpirePBEmpire Member Posts: 676
    This has to be one of the most annoying error i have encountered so far. I saw one of @tshirtbooth menu pop up template and it had the same rules but that worked flawlessly.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    make sure you dont have any constrains setting your self.StartX value.
    in my experience interpolate is bulletproof as long as you don't have two changing the same value firing at once. your rule is pretty simple and i've never had problems with it.

    delete the rule and create a simple one first:
    when game.Pause = 1 interpolate self.positionX to 512 otherwise interpolate self.positionX to 0
    if that works, then try throwing in a variable
  • PBEmpirePBEmpire Member Posts: 676
    @jomulcahy I ended up doing that and it worked but it is a bit "long-winded" as you have to edit the end position for each actor. But it works
Sign In or Register to comment.