Constrain to global variable with something else...messes up the game.

SandbirdSandbird Member Posts: 69
edited November -1 in Tech Support
I have 2 global variables. (gameX,gameY) of an actor.
Then on another actor i constrain its x,y to those variables, but for y = gameY - 40.

Thats because i want the second actor to be a bit further down.
Now this is what happens and messes up my whole game, and i have to revert back from a backup.

Until i find the proper value (40) i had to play a bit...like 20, 30, 50 etc....until i get it right.
But in the meantime....the whole game goes haywire. Before i get to 40, my actor that has this constrain attached to it, disappears from the stage or goes at X = 0 when Y is where it suppose to be.
And not only that, all my animations on stage are not working.

Deleting the actor from stage everything comes back to normal...
Placing a new actor from the prototype back on stage, (while i was editing the prototype before and not the on stage actor), everything works fine again. That is until i start playing with the Y again.

This happens ALL the time in EVERY project i've done.

This happens when the animations are in place inside the actors and constrains are in effect.

Edit: I figured out something else....it happens on the 3rd time i edit the Y value.
I just tried the project again with 30, then 40, and at 50 the actor got stuck on the Y axis.

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Sandbird; I think I get what you're after: you're constraining an actor to another actor's moving position? If that's right then constrain to the moving actor's x and y-40 position, and you won't need the variables/attributes.

    Hope that sorts it for you.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • SandbirdSandbird Member Posts: 69
    Hi gyroscope
    How can i constrain to another actor if the 1st one hasnt set his X,Y in a global variable, so the 2nd one can constrain to those values ?
    Am i missing something here ?

    My 1st actor has an X,Y position.
    My 2nd actor has animation on it and constrains to 1st actor's X,Y, and also constrains a global variable with its Y position, and also spawns a 3rd actor
    The 3rd actor has its own animation and is constrained to the 2nd's actors Y position.

    All this works fine. But when i try to play with the 3rd actor's Y value, ex: 2ndActors.Y + 30, until i get the correct 30 (maybe its 35 or 45, thats my problem..i have to do it manually and see on stage), then on the 3rd try that i do...the actors gets busted.
    I have to delete him and do him again.
    If i automatically do 2ndActors.Y + 50, then its fine...but if i play with it 2 more time...same thing happens.
Sign In or Register to comment.