Keeping a player actor on a moving platform that's interpolating horizontally

cheesemoleocheesemoleo Member Posts: 1
edited November -1 in Working with GS (Mac)
Hey guys,

I've searched the forums and youtube for a solution to this problem. It has been brought up multiple times but never well answered. (I'd love to be proven wrong here)

I want my player actor to jump on to a moving platform (platform is interpolating left to right, and back), and "stick" to the platform, that is: the player's movement becomes relative to the platform rather than the scene.

Right now the player actor has to keep walking left or right to match the movement of the platform.

I've tried creating a game attribute "playerX" and constraining it to player.position.X. Then, in the moving platform's behaviors, upon colliding with player, it constrains/changes (neither work) "playerX" to the platform's position.X.

This didn't work. i think because we get two behaviors both trying to constrain the same attribute.

I've also tried to create a bolean game attribute called "onplatform". Then in the actor behaviors i created a rule that says when actor collides with moving platform constrain "onplatform" to true, otherwise change attribute to false. I thought this would constantly keep the player on the platform. This also didn't work.

Is there an easy way to switch player's movement to relative to the moving platform rather than relative to the scene?

GameSalad has been an amazing tool for me, and I have a fairly well developed game now. This is the first obstacle i can't seem to overcome. My success has been due to this great community, and the all-mighty Tshirtbooth. Thanks! Whether or not this gets figured out, you guys pwn.

Comments

Sign In or Register to comment.