Rotating platform

EminemEminem Member Posts: 667
edited November -1 in Working with GS (Mac)
I have an actor and i want when the actor goes on the platform, if the actor goes over to the left i want it platform to swing to the left and if the actor goes to the right of the platform, then the platform swings to the right,

Anyone know how to do this?

thanks

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Swing like what/how? or do you mean rotate?

    You will have to make a local variable in the platform that checks on the characters X position in relation to the platforms self.Position.X

    Something like if X_Position of character > self.Position.X and platform overlaps or collides with character then do X

    You could make the platform variable global but then if you have more than one of the same platforms they will all move when your character goes over to the left or right.

    Darren?
  • EminemEminem Member Posts: 667
    Hi darren

    i mean swinging left and right, sort of like in the game Red Balls Of Goo ( I truly enjoy your games)

    But i dont fully understand what you mean, can you please be more detailed

    Thanks for your help.
  • UtopianGamesUtopianGames Member Posts: 5,692
    So when your character is on the right side of the platform you want the platform to move right?

    Darren.
  • EminemEminem Member Posts: 667
    I want the platform to tilt right
  • UtopianGamesUtopianGames Member Posts: 5,692
    I have this in my platform template but what ya need to do is...

    In the platform you want to rotate:

    Add a real attribute and call it StartY

    Then do change attribute StartY to self.position.Y

    Then do..Constrain self.position.y to StartY (this stops it falling)

    In the physics part of actor make it movable and leave fixed rotation unchecked.

    I thought you meant this when i 1st read it so added it to the template.



    Darren.
  • EminemEminem Member Posts: 667
    It does nothing. inside the platform i added a real, and have constrained and changed attribute inside the platform, but what should i do to my actor thats going on to the platform?
  • EminemEminem Member Posts: 667
    http://appaddict.net/wordpress/wp-content/uploads/2010/11/rbog-09.jpg

    image

    Darren this is what im talking about

    how did you do it?
  • UtopianGamesUtopianGames Member Posts: 5,692
    You have to drag a collide behavior into your character and select your platform for the character to run on top of it.

    Darren.
  • expired_012expired_012 Member Posts: 1,802
    I think he's talking about the rotating platforms like the one in the middle
  • EminemEminem Member Posts: 667
    i am talking about the one in the middle
  • EminemEminem Member Posts: 667
    For some reason when the actor moves left and right the platform swings but, the patform moves left and right any clue why this happens?
  • UtopianGamesUtopianGames Member Posts: 5,692
    Try constraining the X like i showed you how to do the Y.

    Darren.
  • EminemEminem Member Posts: 667
    awesome! Thank You Darren!
Sign In or Register to comment.