How do you create fully functional moving platforms?

FrazzleFrazzle Member Posts: 223
edited November -1 in Working with GS (Mac)
whenever I try to create a moving platform I put in 5 behaviours:
Constrain linear y movement to 0.
Change movement angle to _.
Change movement speed to _.
constrain linear x movement to movement speed.
when platform collides with wall change movement angle to -movement angle.

But when the player jumps on it, it goes down a bit.
What am I doing wrong?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Frazzle said:
    whenever I try to create a moving platform I put in 5 behaviours:
    Constrain linear y movement to 0.
    Change movement angle to _.
    Change movement speed to _.
    constrain linear x movement to movement speed.
    when platform collides with wall change movement angle to -movement angle.

    But when the player jumps on it, it goes down a bit.
    What am I doing wrong?

    Try increasing the density of the platform (by a lot)

    OR

    also you could create a self attribute called self.InitialY

    then in the platform:

    change self.InitialY to self.positionY
    constrain self.positionY to self.initialY (instead of constraining linearVelocityY to 0)
  • FrazzleFrazzle Member Posts: 223
    1. I've increased density to 20 and it still budged so yeah, the density must be very,very high.
    2. I tried doing something like this with the save attribute behaviour but it never worked (probably because i don't know how it works itself) but this seems foolproof.

    I'll try it out and report back.
  • FrazzleFrazzle Member Posts: 223
    It works. Kinda.
    Basically when the player goes on to the platform, it sinks into it and eventually goes through. But there must be a solution I reckon.
    Any ideas?
  • ChaserChaser Member Posts: 1,453
    He really means a lot. I use 40000 as my standard number density
  • FrazzleFrazzle Member Posts: 223
    WOW.
    That might just work...

    Again,I'll report back.
  • FrazzleFrazzle Member Posts: 223
    Guess what, it works!
    I mean, if the player stands on it for half an hour the player will slowly sink but that's the compromise I'm going to have to take.
    Thanks for the help Sci-tunes and Chaser.
    I may post this as another topic but seeing as you two seem capable...
    How do you make the player involuntarily move with the platform?
  • ChaserChaser Member Posts: 1,453
    Play with friction
  • NesesitaGamesNesesitaGames Member Posts: 160
    Frazzle, I'm curious how you finally got it to work- did you use the Save Attribute feature? I'm having the same problem with my platforms, even with density at 40,000 and a Constrain to Y after 0.1 seconds.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Here's the best solution (I'm pretty tired right now, should have thought about it sooner). Make each platform nonmovable and move it with interpolate. Then it won't move down at all.
  • FrazzleFrazzle Member Posts: 223
    Actually Scitunes was right at the start! Basically I have the player at *checks game* 1 density. The patform has 40,000 density as chaser pointed out.
    I change the initial Y position to position y and after 0.1 seconds constrain y position to it. And it actually works! Sure,eventually the player is going to sink, but that will take ages.

    Anyway, I FINALLY MADE THE PLAYER FOLLOW THE PLATFORM PERFECTLY,EVEN UPSIDE DOWN! So, here's the secret:
    I created an global attribute called force movement. make the platform constrain the attr. to its linear x movement. Then in the player programming it says if left and right are up and linear y movement is 0 constrain linear x movement to force movement.
    Voila! it works beautifully. And seeing as I'm making a VVVVVV style game, i found out it works as well upside down.
    *takes breath*
    So anyway please say if you want to see this in action and i will message you a youtube video of this game.
  • FrazzleFrazzle Member Posts: 223
    Chaser said:
    Play with friction

    Oh and by the way, this didn't work.
    I thought it would, but sadly it isn't that simple.
Sign In or Register to comment.