Moving Platform Problem - Solved

BalvamarBalvamar Member, PRO Posts: 117
edited May 2015 in Working with GS (Mac)

I have used Jamie Cross's tutorial for moving platforms, and it works great....however,
I have found that when I have 2 or more horizontal platforms in a scene, that are both constraining to the same variable. e.g. hPlatformX that it causes problems with the offset, which makes the player slip when standing still.

I placed one platform in the scene and it worked fine. When I placed the second however it causes problems.

Any help would be much appreciated, as it is one of the final problems stoping us from finishing our project.

cheers ;)

Comments

  • BalvamarBalvamar Member, PRO Posts: 117

    Ok, I may have solved this myself. I have put the constrain behaviour in a rule that is only triggered when colliding with the player. It appears to work at the moment, however I tried this yesterday and it moved me to a different scene. I post again if it stays fixed.

  • BalvamarBalvamar Member, PRO Posts: 117

    Ok, there are 2 things that made the player behave strangely.

    1. In the layer if the platform is above the player the constrain does not update before the player and they get out of sync. (This was mentioned in the tutorial, thanks Jamie ;) )

    2. I had the behaviour in the player using a tag for hPlatforms instead of the individual actor. This seemed to have the effect of causing all hPlatforms to update the game attribute at the same time producing random effects. When I changed it to the individual actor all seems to work well.

  • BalvamarBalvamar Member, PRO Posts: 117

    One last thing, which I think was a major contributor. I had 2 actors under the hPlatform tag. One was an old one I had not deleted. Now only have 1 actor with different images. Everything is working great :)

  • jay2dxjay2dx Member Posts: 611

    Make a real self attribute in the platform actor of either your platforms x or y location and have a rule that changes the real attribute to the location of your platform, so if you want to lock its x location so it only moves up and down maybe on the y axis, then have a rule that is self collides with player, constrain self x or y to the self real x or y attribute that was previously saved at the start of the scene,

    This way you can have many platforms that only trigger the constrain when in contact with the player, don't use world/game attribute for this. It should work

Sign In or Register to comment.