Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

How to limit movement to only x-axis and not in y-axis?


kriket
 Share

Recommended Posts

I want my platform to move when the player lands on it but only in x-axis and not y-axis. Phaser has body.fixedRotation for locking rotation. Is there anything like that for one of the axis?

 

I do not want to do this in the update function?

body.velocity.x = 0;

Link to comment
Share on other sites

You want it to move from the collision momentum or you set the X speed manually? (and velocity.x = 0 and move only in x axis are conflicting in your question)

 

 

collision momentum. So say when a player lands on it, the platform moves in down in y, until it reach the game bounds and get killed. Dont wont it to move in x from collision momentum, which is what he does when the player hit it by mistake from the side. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...