Attribute Manipulation Depending On Position

robert.mccarthyrobert.mccarthy Member Posts: 165
edited November -1 in Working with GS (Mac)
Hi All,

I'm having a problem with attribute manipulation depending on position (X or Y).

Basically, I want to do the following:

When an actor's position changes in the 'X' position 1 pixel, then I want it to move 3.8 pixels in the 'Y' position.

So if it moves along 'X' for 10 pixels then it will also move along 'Y' in 38 pixels. Then if it moved back along 'X' in the negative for 1 pixel the 'y' position would only move 34.2

I hope I have not made this confusing, and as easy as possible.

Cheers,

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    I would toy with self attributes on the actor. So (I don't know if this will work but might give you a head start...), create an attribute within the character that's called "Starting X" and "Starting Y."

    Have them change as the character's position changes. So if the character moves 10 to the right, then do a Change Attribute self.Starting X to 10, and, "self.Starting Y to self.Starting X * 3.8" Then do a constrain attribute on the character: "position.X to self.Starting X" and "position.Y to self.Starting Y"

    I'm not 100% certain on the logic there (I'm still fairly new to GS and programming for that matter), but it might give you some direction on where to start...

    Hope that's helpful.
Sign In or Register to comment.