How do you create fully functional moving platforms?
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?
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
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)
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.
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?
That might just work...
Again,I'll report back.
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?
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.
I thought it would, but sadly it isn't that simple.