Actor is moving faster than camera
peterraad
Member Posts: 56
ok so i have an actor that moves according to an on screen joystick now his speed is 110 and the scene's width is 10000 and height is 320. i have the scene.camera.origin.x and y constrained to the players x and y positions. the only issue is that when i move the player it moves faster than the camera which means it can leave the scene also the player is non scrollable. I need it so that the camera can move HOWEVER fast the player is going. Note: i cant use control camera because it messes up my enemyspawner (if you look at my previous discussion). Please help and thank you
This discussion has been closed.
Comments
bump please somebody help
Ok . . .
The camera's origin is the bottom left hand corner of your scene . . . so rather than constraining the camera origin to the player's X and Y position you would need to (assuming you want the player to remain in the centre of the screen) constrain the camera's X origin to [the player's X minus half the camera size width] and the camera's Y origin to [the player's Y minus half the camera size height].
So, assuming your game is 568 x 320 pixels:
constrain camera's X origin to player's X - 284
constrain camera's Y origin to player's Y - 160
@socks please can you read my private message
Why do you want the conversation to be made private / secret ?
@socks so I can send you my template I don't want it to be publicly accessed
This same post has been made multiple times.
/closed
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User