Edit Camera Position

JoshKahaneJoshKahane Member Posts: 470
edited November -1 in Working with GS (Mac)
Hi

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.

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    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.
    http://gamesalad.com/wiki/how_to_gsc_follow_another_actor

    i.e.
    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 Member Posts: 470
    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 Head Chef, Member, PRO Posts: 1,803
    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 Member Posts: 470
    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 Member Posts: 470
    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.
Sign In or Register to comment.