So I have a problem. I’m making a game, and when stuff moves on the screen, I want the camera to follow the player.
I’ve done that by putting everything in a display group, and setting the coordinates of that display group relative to the players’. Kind of like this:
displayGroup.x = - player.x + 200 -- [or any constant]
This works great, except that the camera movement is rigid, and I don’t like that. It feels like it’s nailed to the player.
So I want to make it smooth. Like “follow” the player, with a smooth animation to it. How do I do that?
I tried with transition.to.
transition.to( displayGroup, {time=10, x = - player.x + 200} )
But that doesn’t work at all. For once, the animation isn’t smooth AT ALL, and also that camera movement is completely erratic. It has no relation to the player’s movement.
What is wrong here?
Thanks! [import]uid: 13720 topic_id: 5195 reply_id: 305195[/import]
[import]uid: 13720 topic_id: 5195 reply_id: 17451[/import]
[import]uid: 7980 topic_id: 5195 reply_id: 19129[/import]