Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Edit Camera Position

JoshKahaneJoshKahane Posts: 470Member
edited 5:44PM in Working with GS (Mac)

So Im back with a new issue, haha. This time a camera issue. In my game I want my character actor to be constantly moving and at the left side of the camera, but I cant work out how to do this without my actor moving to middle to right side.

So I want to be able to have my actor constantly being tracked on the left side of the camera. How? If you don't know what I mean I'll try explain further, but I would really like some help, thanks.


  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    Sounds like a certain plumber who jumps on mushroom like creatures and turtles.

    Create an actor that follows the main actor but with an offset, and give it the control camera behavior.

    Create a game attribute called playerX.
    Create an actor with self.Color.Alpha = 0, to make it invisible, and give it 2 behaviors:
    - Control Camera
    - Constrain Attribute : self.Position.X = game.playerX
  • JoshKahaneJoshKahane Posts: 470Member
    Haha, no it wouldn't be that character, I seem to have portrayed it wrongly.

    Anyway, that makes sense, so I have my main character that the player will see follow an invisible character which controls the camera.

    Although, Im just finding it a little hard to understand in practice. So I have done something wrong. When I test it, the actor you see jumps straight to the invisible one. Rather than follows. Do I want it following or chasing? Whats the difference?
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    The invisible actor controlling the camera, make that non-collidable and having its position set relative to the actor you move around.

    The actor you move around always constrains game(global) attributes to its position. Those game attributes will be read by the invisible actor. i.e. Its position will always be a set distance from your player.
  • JoshKahaneJoshKahane Posts: 470Member
    Ok well Im still trying to get this to work, you have kick started me though once again CodeMonkey, haha, thanks.

    Something which could be implemented in a future version of Gamesalad is being able to move the actual camera box within the screen box. This way not having to create in invisible actor etc.
  • JoshKahaneJoshKahane Posts: 470Member
    Well I have done it, not quite how you explained, so I don't know wether it will be ok or not. But I just had the invisible actor control the camera, and have my other actor travel at the same speed behind so that he stayed where I wanted on the screen.
This discussion has been closed.