interpolate vs move-to when using camera control on actor?
jsorr2
Member Posts: 279
I'm wondering if interpolate movement is better when using camera control on the main actor?
I use "move to" currently and when the actor controls the camera its obvious that the actor stops every half a second which ruins the illusion of smoothness.
Therefore, would using interpolate make camera control smooth while being confined to a grid?
Best Answer
-
ashtmj Posts: 405
Constraining the game.player X and game.player Y is just to track your players X and Y location so the camera actor knows where to go on the screen. you can make your player actors movement anything you like, accelerate, move to, etc.
Here is a quick game I made with grid movement plus a camera that follows
https://www.dropbox.com/s/mm9ncark6xodkhh/girdmovementwithcam.zip?dl=0
Answers
I'd go with two actors and do this:
Make 2 real global attributes called
Player X
Player Y
player actor:
Constrain game.player X to self.positionX
Constrain game.player Y to self.positionY
and in the camera actor:
Constrain self. motion. liner velocity X to 5(game.playerX-self.position.X)
Constrain self. motion. liner velocity Y to 5(game.playerY-self.position.Y)
the reason begin, interpolate overrides just about everything else, so using self motion keeps the moment easier to control.
you can see this type of movement in action starting at about the 6 min mark of this video.
Hope this info helps
Thanks for the reply!
That's a genius way of doing the camera; in the video it looks fantastic.
When you say constrain game.player x to self position x, is that for the camera or to move the main character (actor)? The main movement I use in my game is move-to because I need to move on a grid.