How to make sprite sit on a moving sprite

后端 未结 4 1934
暗喜
暗喜 2021-01-22 04:19

How to make a sprite sit on a moving sprite and travel with it. I have made the red box jump with impulse and when it falls on the black block down which is moving, the red box

4条回答
  •  轮回少年
    2021-01-22 05:02

    If you have an skaction that has a duration, it keeps the object moving until the duration is over, creating the object to not stay on another object. So rather than using a action to move the object, update its position with the update function, and make it stop moving when it touches a block.

提交回复
热议问题