Actor on moving platform help please

VGXVGX Member Posts: 796
edited February 2012 in Working with GS (Mac)
Hi,
I want my actor to land on a moving platform but without me having to move the actor with the platform. I want the actor to land on it when it moves and stay on it.

How do I do this? Thanks

Comments

  • ashtmjashtmj Member, PRO Posts: 405
    if player collides with ledge constrain self motion X to the same speed the ledge is moving
  • VGXVGX Member Posts: 796
    Hi,
    Sorry I don't understand what to do. I have tried but clearly doing something wrong. Sorry to be a pain could you give examples?
    Thank you :)
  • MotherHooseMotherHoose Member Posts: 2,456
    which way is the platform moving? left and right? … or up and down?

    left and right … as @ashtmj said constrain X
    up and down … constrain the playerActor's Y

    @};- MH
  • VGXVGX Member Posts: 796
    the platform is going left to right, heres the rules in the platform,

    ACCELERATE- direction 270, Acceleration 400, Relative to actor

    COLLIDE- floor

    CHANGE ATTRIBUTE- (self.M.L.V X) to 100

    RULE- self.pos X > 400
    CHANGE ATTRIBUTE- (self.M.L.V X) to -100

    RULE- self.pos X < 100
    CHANGE ATTRIBUTE- (self.M.L.V X) to 100

    for the physics, Density is 1, Friction and Restitution is 0
    Fixed Rotate and movable are both ticked

    What do i change? and where do i add the constrain X?

    Thanks again
  • MotherHooseMotherHoose Member Posts: 2,456
    gameAttribute with a real type … platformX … (only activate when collides with playerActor)

    -on the platforms: Rule: when: overlap or collides with playerActor - constrainAttribute: game.platformX To: self.Position.X

    -on playerActor Rule: when: overlap or collides with platform - constrainAttribute: self.Position.X To: game.platformX

    then constrains are only active during overlaps/collides

    @};- MH
  • VGXVGX Member Posts: 796
    edited February 2012
    Hi, Sorry to keep asking but this should be the last time. I have sorted the constrain x thing. thank you for that. but having another problem, how do i make a platform go up and down? this is the rule i have for left to right,


    ACCELERATE- direction 270, Acceleration 400, Relative to actor

    COLLIDE- floor

    CHANGE ATTRIBUTE- (self.M.L.V X) to 100

    RULE- self.pos X > 400
    CHANGE ATTRIBUTE- (self.M.L.V X) to -100

    RULE- self.pos X < 100
    CHANGE ATTRIBUTE- (self.M.L.V X) to 100

    for the physics, Density is 1, Friction and Restitution is 0
    Fixed Rotate and movable are both ticked


    but don't know how to do up and down, thought of changing the X to Y but that doesn't work.
    thank you for your help
  • MotherHooseMotherHoose Member Posts: 2,456
    change the X to Y and also change platform's self.Motion.Linear Velocity .Y

    hooray! you got the left and right! and, now you can get the up and down!

    @};- MH
Sign In or Register to comment.