How do you stick an actor to the left side of the screen?

tcla75tcla75 Member Posts: 71
edited November -1 in Working with GS (Mac)
OK here is what I am trying to do. You have the actor running right. The background is scrolling by but the actor stays about an inch away from the left side of the screen. So hes facing right. Hes running but not in the center of the screen. On the left side of the screen. Does anyone know how this is done? If your not sure what I mean I can post screen shots. Thanks

Comments

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    not entirely sure what you mean...

    is the camera control behaviour inside your running character. (if thats the case try adjusting the camera affected area, click the little camera icon on the scene window and adjust the camera area, making it less wide)...
  • AppsRacKAppsRacK Member Posts: 346
    I didnt get it either but if its about camera try watching this.



    -drahc
  • tcla75tcla75 Member Posts: 71
    I have tried to move the little box in the window below to where my actor is but it won't move there. It seems to be stuck on centered.

    image

    The reason I am trying to change it is so when he is running he is not in the center of the screen like the picture below but where I have the black dot so as he is running he can see the platforms ahead of him.

    image
  • tcla75tcla75 Member Posts: 71
    Ok so I was serching youtube to see if I could find any tutorials to help me do what I am trying to do. I found a video that shows perfectly what I am trying to do but it doesn't show how to do it?

    <iframe title="YouTube video player" class="youtube-player" type="text/html"
    width="640" height="390" src=""
    frameborder="0" allowFullScreen></iframe>
  • simo103simo103 Member, PRO Posts: 1,331
    I believe that example has an invisible actor constrained off the main actor's x position +100 or something like that so the camera is tracking the invisible actors position not the main actor.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    That's what I did in my game z is for zombie. I have an invisible actor that the camera follows. In my case the camera is moving At a steady pace allowing the player to move anywhere they want, but you could easily just constrain that actor's x position to the players position + 200 or something.

  • DrGlickertDrGlickert Member Posts: 1,135
    Yeah, I'd create a PlayerX and a PlayerY ( constrain these to the player's self.positionX and self.positionY)

    Then have an invisible actor on the HUD (or any layer that you've created) layer. Have that invisible actor have the camera control and have it constrained to: PlayerX + 100 (or whatever value you want) and PlayerY.

    That should give you the effect that you're looking for.
  • tcla75tcla75 Member Posts: 71
    Hi guys thanks for that. This looks like it will work great.
  • tcla75tcla75 Member Posts: 71
    Ok got around to trying it out and not sure what I am doing wrong. I created a PlayerX and a PlayerY attribute and put these rules in the player

    image

    and these rules in the invisible actor

    image

    I know I am doing this wrong but it's what I got from the advice above. What steps am I missing?
  • tcla75tcla75 Member Posts: 71
    Figured it out. Used Tshirtbooth's youtube video "Constraining one Actor to a specific point on another Actor in iOS games made with GameSalad".
Sign In or Register to comment.