Camera offset causing actor to move continuously
rchang
Member Posts: 3
Hello,
I following this great tutorial to have an actor follow the mouse/touch for a game scene that is bigger than the screen size:
Camera Offset: following mouse or touch in large scenes using GameSalad
http://www.youtube.com/user/GameSaladCookbook/#p/search/4/bfKYqsuNgXY
In short, it uses the camera's x and y offset to get the actor to move to the correct point.
This mostly works except that if the user touches and holds down on a point on the far right of the screen, the camera moves, which changes the camera offsets and thus the coordinates touched, and the actor KEEPS moving to the right, never getting to its destination touch.
I would like the actor to stop moving but if I'm using camera offsets, and having the actor continuously follow the mouse/touch, I'm not sure this is possible.
Any ideas?
Thanks!
I following this great tutorial to have an actor follow the mouse/touch for a game scene that is bigger than the screen size:
Camera Offset: following mouse or touch in large scenes using GameSalad
http://www.youtube.com/user/GameSaladCookbook/#p/search/4/bfKYqsuNgXY
In short, it uses the camera's x and y offset to get the actor to move to the correct point.
This mostly works except that if the user touches and holds down on a point on the far right of the screen, the camera moves, which changes the camera offsets and thus the coordinates touched, and the actor KEEPS moving to the right, never getting to its destination touch.
I would like the actor to stop moving but if I'm using camera offsets, and having the actor continuously follow the mouse/touch, I'm not sure this is possible.
Any ideas?
Thanks!
Comments
There is no completion checked or relative to actor/scene to check.
I use constrain attribute behavior for the actor:
constrain: self.Motion.Linear Velocity X
to : self.Speed *(( game.Mouse.Position.X + game.camX )- self.Position.X )
where camX and camY are constrained to the camera offset x and y.
I found this technique on the forums for following the mouse pointer.
Thanks!
Rich