I want the charachter to be able to move along with a platform that is also moving.
Actor character = getOneIntersectingObject(/*the name of your character's class*/.class);
if (character != null) {
character.setLocation(getX(), getY() - getImage().getHeight() / 2 - character.getImage().getHeight() / 2);
}private int direction = 3;
public void act()
{
move();
}
private void move()
{
if ((direction < 0 && getX() == 0) || (direction > 0 && getX() == getWorld().getWidth()-1)) direction = -direction;
move(direction);
} for (Object obj : getIntersectingObjects(Actor.class)) {
((Actor) obj).setLocation(((Actor) obj).getX() + direction, ((Actor) obj).getY());
} if (direction < 0 && getX() <= getImage().getWidth() / 2
|| direction > 0 && getX() >= getWorld().getWidth() - getImage().getWidth() / 2) {
direction = -direction;
}setLocation(getX(), getY()-1); Actor player = getOneIntersectingObject(Player.class); if (player != null) player.setLocation(player.getX()+direction, player.getY()); setLocation(getX(), getY()+1);