GameSalad Constrain Truth or Myth

fueguitofueguito Member Posts: 15
edited November -1 in Working with GS (Mac)
I am new to Game Salad but I am pass a lot of the basic so i thought. In the last 2 weeks i looked over so many tutorials that in my sleep i was hearing " Hey everybody t shirt booth here". :)

Here goes I have 3 columns of 10 boxes stacked one on top of another. All 30 boxes are the same character (green box) that was copy over and over. On the green box i set Accelerate to 500 direction down relative to scene.

i have a white box also with same Accelerate he is at the bottom of the columns going left and right, Set on collide with the green Box after 2 seconds it will destroy the green box then continue to go left and right. Then the next boxes on the column come down so you can destroy the next set.

Problem is on collide he moves the whole columns left and right. Can you in games salad constrain just the X to its current location without it being a specific location....example you cant set Constrain Attribute (Self.Position.X) To (Value goes here) because it will set all 30 blocks to that value. Using that one character (green box) Can it be done or is it a Myth just in my head.

I seen in the forum work around use density but the column still move and yes white box density was set to 0

Comments

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    If you want to constrain to a specific place, make a self real attribute that you change to self.position.x at the start of the game.

    Now you can constrain self.position.x to self.startX and it'll work for all 30 or so actors individually.

    Ace
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    Try putting friction to 0. (not on my mac at the moment, but think friction might work).

    Otherwise in reply to your question.

    You could try adding a self. Attribute for starting x position.

    Add a behaviour 'change attribute'.

    Change self attribute starting x position to current x position.

    Then after that behaviour add a constrain. Constrain self x position to self starting x position.

    Sorted.

    Sorry it's not more detailed but I'm typing on my phone.
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    Ace beat me to it. Damn my slow typing thumbs
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    It was more detailed than mine... And you have to type with Lego fingers! Props :)

    Ace
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    Very true ace. But on that basis you don't even have hands, which makes my little plastic Lego hands pretty awesome.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    I fire cookies out of my head strategically on to my keyboard... It's tedious but sure does get my practice up for Angry Birds style trajectories ;)

    Ace
  • fueguitofueguito Member Posts: 15
    Thanks a lot guys that worked perfect. hate to take anyone's time but 3 days on that I felt like kicking myself there for a moment. :)
  • fueguitofueguito Member Posts: 15
    To anyone who reads this in the future with the same problem, to clarify a little more you need to 1.Double click your actor and in the actor you would find the self attribute.
    2.Click the + under attributes select (real) give it a name like (Start position) you can leave it at 0
    3.Add change Attribute to this character (self.start.position) to (self.position.X)
    4.Then add a constrain (Self.Position.X) To (self.start position)
    Works GREAT!!!

    Once again thanks a lot guys.
Sign In or Register to comment.