Make a platform rise and fall?



  • I'm trying to achieve the following:
    I have a platform that I want to move up and down on the y-axis, like an elevator. I want it to move up and down based on a lever next to it. You pull the lever up, the platform goes up, you pull it down, the platform goes down. Any thoughts?



  • Use the Execute Sequence behavior. Connect it to two move behaviors. Each time the sequence is triggered the "next" behavior will run. I'll post a screenshot:
    0_1488383803488_IMG_1898.PNG



  • Thanks for this! Is there a way to have the lever platform relationship even more closely tied? What I'm trying to do is: you drag the lever up 10, the platform raises 10. You drag it down 6, the platform lowers six.


  • Admin

    We also have a movable platform behaviour.
    This behaviour does some extra physics tricks so your player/object stays on the platform as it moves.



  • @This you could subtract the "stopped touching" from the "started touching" and move the platform by the result.
    I don't remember for sure, but you probably want world coordinates turned on on the touch behaviors.