Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    help with camera following player sprite on maps

    Beginners
    4
    7
    286
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • waldron
      waldron F last edited by waldron

      loaded up a map and player no problem but cant get the camera to scroll to follow player, i need to camera to follow in all directions

      1 Reply Last reply Reply Quote 0
      • mario.bodemann
        mario.bodemann F last edited by

        Hey,

        so far, I can't really assist you. What did you already try?

        Glancing over the problem, maybe https://fuzearena.com/help/view/centreSpriteCamera can help?

        waldron 1 Reply Last reply Reply Quote 1
        • waldron
          waldron F @mario.bodemann last edited by

          @mario-bodemann il try it tomorrow,, iv tried all sorts but dont think iv used that yet as im still learning.
          bit confused on what to put in for the x . y pos

          centreSpriteCamera ( xpos, ypos )

          Retrocade_media 1 Reply Last reply Reply Quote 0
          • Retrocade_media
            Retrocade_media F @waldron last edited by Retrocade_media

            @waldron If it helps, the x and y will define the top left pixel of the camera. So if you want to center on an x and y:

            spritecamera(x - gwidth()/2, y - gheight()/2)

            1 Reply Last reply Reply Quote 1
            • poof92
              poof92 last edited by

              If you want the camera to follow your Sprite then do this : centerspritecamera(player.x,player.y) that should do the trick.

              1 Reply Last reply Reply Quote 3
              • waldron
                waldron F last edited by

                Thankyou for your help this helps me massively on a number of projects

                1 Reply Last reply Reply Quote 1
                • waldron
                  waldron F last edited by

                  Working thankyou ! I know its something so simple but I'm only just starting to use maps instead of the level arrays and got confused

                  1 Reply Last reply Reply Quote 2
                  • First post
                    Last post