character jumping on moving platform?

allc1865allc1865 Member, PRO Posts: 777
Hi. I want my character to be able to stand on a platform that moving. So far I have turned my density up to 1,000, which works, but if, say, my character bumps my platform, it'll go flying away. I have collisions set up already, and Also, I can't turn moveable off, because then it wouldn't move... So that wouldn't work. Any idea? Thanks! :)

Best Answer

  • -Timo--Timo- Posts: 2,313
    Accepted Answer
    Sorry, my fault. It has to be <= and >= because it moving down to 76 and then its not smaller then 76 ;) you also can use =
«1

Answers

  • -Timo--Timo- Member Posts: 2,313
    you can constrain self.position.y it to self.position.y? :)
  • allc1865allc1865 Member, PRO Posts: 777
    I have a Constrain Attribute set to self.Position.Y to self.Position.Y?
  • -Timo--Timo- Member Posts: 2,313
    I have a Constrain Attribute set to self.Position.Y to self.Position.Y?
    I don't know if you have that ;) does that work?

  • -Timo--Timo- Member Posts: 2,313
    you also can put his moveable off and use interpolate to move it.
    I don't know how you are moving it but you can try something like

    if self.position.X < 100
    interpolate self.position.X to 200
    during 1 sec

    if self.position.X >200
    interpolate self.position.X to 100
    during 1 sec
  • allc1865allc1865 Member, PRO Posts: 777
    I have:
    ---for the speed of the platform---
    self.Motion.Linear Velocity.Y to 200.
    ---constrain attribute---
    self.Position.Y to self.Position.Y
    ---don't go higher than...--- ( for my Y coords to move the platform)
    Rule > Attribute > self.Position.Y is greater than 276
    Change Attribute > self.Motion.Linear Velocity.Y to -400
    --don't go lower than--
    Rule > attribute . self.Position.Y is less than 76
    Change Attribute > self.Motion.Linear Velocity.Y to 400

    My screen shots aren't working
  • -Timo--Timo- Member Posts: 2,313
    Use interpolate and uncheck moveable. Like I said in my other post ;)
  • allc1865allc1865 Member, PRO Posts: 777
    I would create a rule for that, right?
  • -Timo--Timo- Member Posts: 2,313
    I would create a rule for that, right?
    Yes, make 2 rules.
    In the first rule you put
    If self.position.y > 276
    Do
    Interpolate self.position.y to 76
    During 2 seconds (this is the speed)

    In the second rule you put
    If self.position.y < 76
    Do
    Interpolate self.position.y to 276
    During 2 seconds (this is the speed)
  • allc1865allc1865 Member, PRO Posts: 777
    Okay. That works, but it jerks down, and if I bump it, it still flies away...
  • -Timo--Timo- Member Posts: 2,313
    Did you put moveable off?
  • allc1865allc1865 Member, PRO Posts: 777
    Yes.
  • allc1865allc1865 Member, PRO Posts: 777
    Actually...I turned it off, and now it doesn't move. It just moved down, but won't come up.
  • allc1865allc1865 Member, PRO Posts: 777
    It works! Thank you very much for your help! :)
  • allc1865allc1865 Member, PRO Posts: 777
    When I'm on the moving platform, my character stays at true when it should return to false, so now my character cannot jump.
  • -Timo--Timo- Member Posts: 2,313
    Do you have if overlaps or collide with platform change jump to false?
  • allc1865allc1865 Member, PRO Posts: 777
    new rule saying actor receives event > overlaps or collides with actor of type > sliding block > change attribute: game.jump to false
    Is that right?
  • allc1865allc1865 Member, PRO Posts: 777
    And that rules goes on character, not the block itself.
  • -Timo--Timo- Member Posts: 2,313
    I can look at it if you want. Can you send the file?
  • allc1865allc1865 Member, PRO Posts: 777
    Right now I can't send it. But those are the rules in my character.
    new rule saying actor receives event > overlaps or collides with actor of type > sliding block > change attribute: game.jump to false
  • -Timo--Timo- Member Posts: 2,313
    do you have if any of these are true?
  • allc1865allc1865 Member, PRO Posts: 777
    No, how would that be set up?
  • allc1865allc1865 Member, PRO Posts: 777
    In the character, theres the flag is touched the ground. That has if actor overlaps or collides with ground, self.jumping false...otherwise timer > self.jumping true.
    I believe that may be my issue here. It's saying if actor is on the ground, turn to false. When I switched that to my sliding block, my black was false, however my ground was not.
  • allc1865allc1865 Member, PRO Posts: 777
    block* not black.
  • -Timo--Timo- Member Posts: 2,313
    I would need to see the file. so when you send it I can help :)
  • allc1865allc1865 Member, PRO Posts: 777
    edited October 2013
    Hi. Here's the file. He says false on the ground, but not any other objects you want him to walk on. Thank you very much!
    https://www.dropbox.com/s/chhk19z7qukpzr3/jump temp..zip
  • -Timo--Timo- Member Posts: 2,313
    I don't understand the problem... does it have to bounce? how much do you want to jump?
  • allc1865allc1865 Member, PRO Posts: 777
    My character is false (he can move right, left, and jump) on the block, which I put in there. But when you switch it to, if actor overlaps or collides on land, then he can no longer jump on the block, but only the land now. He's false on land, but true on the block. And that's really with anything you put in there and want him to jump on or stand on.
    Thanks.
  • -Timo--Timo- Member Posts: 2,313
    you want the player to jump when on block and when on land?
    if ANY of the following are happening
    overlaps or collide with land OR overlaps or collide with block
    do
    change jump to false

    and when I open the project its bouncing up and down. is that something you want?
  • allc1865allc1865 Member, PRO Posts: 777
    It's bouncing up and down...? No...
    Thanks for your help! :)
Sign In or Register to comment.