camera offset

paulitsmepaulitsme Member Posts: 109
edited November -1 in Working with GS (Mac)
SORRY I PUT THIS IN THE WRONG FORUM. CAN SOMEONE MOVE IT.

I want the camera to follow an actor but offset so the camera is always focused 150 pixels ahead of the actor.

I have tried doing it by constraining its position and using a hidden actor 150pixels in front to control the camera. It works but it leads to some jerkyness.

Is there a simple way to get the camera to look 150 pixels to the right of the actor its following ?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I have an invisible actor and I have a game attribute called playerX (integer - I find real is rather jerky). I constrain it to the main character's self.position.X. Then in an invisible actor, I call camera, I constrain it's X to game.playerX and put a control camera behavior in it. Works fine (I do this a lot actually).
  • paulitsmepaulitsme Member Posts: 109
    Maybe its the speed the game runs at but that solution is too jerky :(
  • grayson007grayson007 Member Posts: 3
    I tried this same thing and it's way too jerky in my game too. Using and integer instead of real made no difference.

    There should be an offset built into the control camera behavior.

    It still shouldn't be jerky in the solution mentioned above. Can someone from Gamesalad look into this? I need this fixed before releasing my game.
  • hrsmediahrsmedia Member Posts: 522
    Is there another solution for this?
  • rickdalrickdal Member Posts: 30
    Its hard to say without seeing your game, but have you tried changing the camera "bounding box" thingy? Its the rectangular thing you can scale when adjusting the camera in a scene. It may be that your "bounding box" for the camera is too small. That way, small movements of the player are leading to a camera that is bouncing around too much. You could try to increase the size of the camera's bounding box to make it less jerky.... maybe...
  • dusker24dusker24 Member Posts: 30
    An old thread I know but has anyone found a fix for this? Or will new versions allow a camera offset? Thanks

    Tom
  • old_kipperold_kipper Member Posts: 1,420
    I have been using an offset with no problems, by using an invisible actor for the camera follow-Sending x and y for the main actor to a pair of game integer attributes (using constrains)- change game attribute x and y to self position x and y+80 (to get the offset) and then picking up the changes with constrain to x and y game attributes in the offset actor. It sound like what is listed here but does seem to work for me.

    hope that helps, but I am not sure as if you are already doing this and it ain't working for you...

    kipper
  • JohnnySteelJohnnySteel Member Posts: 8
    I have this issue as well. I have a platformer where players go left or right and jump to platforms above to move up the level. Like climbing a building.

    i found a way to make a smooth offset when the player was going left and right... shifted the camera slightly so, i you're going left, it pushes you off centre right and the opposite when going right.

    The real problem is moving up. I'd done this horizontal offset using MOVE TO and setting the horizontal to game.playerX and (+ or -) the most effective value.

    but when i try to set the vertical to game.playerY the whole thing is jerking. i expected it to fluidly follow up the way it does L & R.

    any ideas what i should try? I did this, rebuilt it many ways with variations, but i feel i must be missing something.

    grateful for any insight
  • JohnnySteelJohnnySteel Member Posts: 8
    sorry, i should add, i did use an invisible camera that was moving with the player character.

    thanks
  • HymloeHymloe Member Posts: 1,653
    Good day gentlemen!

    I think I have found the solution here, which is written above, but perhaps being overlooked.

    I have had GUNS "attached" to my player character, which have been very jerky while moving around. That is because I was using "Change Attribute" instead of "Constrain Attribute".

    I was using "Change Attribute" to set the global attributes "PlayerPositionX" and "PlayerPositoinY" every 0.0001 second. I was then telling my Gun actor to "Change Attribute" to that position every 0.0001 second as well. Not good enough.

    Simply using "Constrain Attribute" to set all our your global attributes, such as storing your PlayerPositionX and Y, and then use Contrain Attribute again for telling your Gun to position itself at the PlayerPositionX and Y.

    As far as I can tell, "Constrain Attribute" is updated and enforced EVERY SINGLE FRAME, and thus produces smooth results.

    If you are using "Change Attribute" with a Timer for situations like this, it will be jerky.

    Don't be jerky. Be smooth!

    :)

    - Hymloe
This discussion has been closed.