Trying to constrain actor width to actor Y position

dr2391dr2391 PRO Posts: 78
edited January 2013 in Working with GS (Mac)
So basically I want to constrain the actors width and height to the actors Y position so that when the actor moves up on the screen the actor gets smaller. This is what I have. The problem is, it doesn't stop getting smaller when the actor stops moving up. It just continues to get smaller till it disappears

Constrain
(self.size.width) to (self.size.width-(self.position.y/20))

Comments

  • dr2391dr2391 PRO Posts: 78
    lol 2 seconds after I post I figure out what I've been working on for half an hour. I just replaced the

    (self.size.width-(self.position.y/20))

    with

    (75-(self.position.y/20))

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Yep, you never want to constrain or interpolate an attribute to itself. When I need to do something like that, I usually have Change Attribute self.originalWidth to self.size.Width at the top of the rules list and then I constrain/Interpolate self.size.Width to self.originalWidth (*/÷/+/- some value).

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

Sign In or Register to comment.