Actor is moving faster than camera

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

Comments

  • peterraadpeterraad Member Posts: 56

    bump please somebody help

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2014

    @peterraad said:
    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.

    Ok . . .

    @peterraad said:
    i have the scene.camera.origin.x and y constrained to the players x and y positions.

    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

  • peterraadpeterraad Member Posts: 56

    @socks please can you read my private message

  • SocksSocks London, UK.Member Posts: 12,822

    @peterraad said:
    socks please can you read my private message

    Why do you want the conversation to be made private / secret ?

  • peterraadpeterraad Member Posts: 56

    @socks so I can send you my template I don't want it to be publicly accessed

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    This same post has been made multiple times.

    /closed

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

This discussion has been closed.