Move constraint on an object that can rotate

kapserkapser Member Posts: 458
edited November -1 in Working with GS (Mac)
Hi,

I'm trying to have a rotating object with a Y/X move constraint. I tried using Linear Velocity and Max speed 0 constraints, and it seem to work, but when the object is rotated or collide with physical objects, it will slowly move down instead of remaining at the same coordinates.

Any idea how to achieve this? I want the object able to rotate but not move.

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    de select un moveable on your object and then use this rule

    When self.rotation = 0
    Interpolate self.rotation to 360

    If you want it to rotate the opposite direction use -360 and then you can play with the duration to get the speed you want.

    ___________________________________________________________________________________
    GS BubbleBall Template HERE!!
    Stacks Level Selection Template HERE!!
    Expanding Option Menu Template HERE!!
    Tenrdrmer's Menu # 3 HERE!!
    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • kapserkapser Member Posts: 458
    Thanks a lot, it's working but is there any way to do this with a physical objects?

    For example, a physical player object would be able to push it to spin, and the player would react phisically to it.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    the only way with movable check to work is to constrain self.position.x and self.position.y
  • kapserkapser Member Posts: 458
    I couldn't make it work. I tried making the constraint following another object but I can't find a way to select the position constraint location as an object.

    I'm searching through the tutorials, but I can't find anything helping me about constraints and attribute expressions.

    Edit: I figured out GameSalad doesn't let us do this so I'll try to do this using global variables.

    Thx for help.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Create self attributes called Start.x and Start.y

    then in your actor place these behaviors at the top in this order outside of any rules

    Change Attribute self.Start.x to self.position.x
    Change Attribute self.Start.y to self.position.y
    Constrain Attribute self.position.x to self.Start.x
    Constrain Attribute self.position.y to self.Start.y

    ___________________________________________________________________________________
    GS BubbleBall Template HERE!!
    Stacks Level Selection Template HERE!!
    Expanding Option Menu Template HERE!!
    Tenrdrmer's Menu # 3 HERE!!
    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • kapserkapser Member Posts: 458
    It doesn't seem to work. Maybe if I set the attribute only once so it doesn't update the coordinates every steps?

    Anyways, that's a lot of questions for just on problem, thanks. I should do fine without this fixed anyways :)
Sign In or Register to comment.