1. #1

    Need Help With Camera Controls

    I basically want to make camera controls for a 3rd person game where you control the camera with the right thumbstick. With the ability to rotate the camera around the player in all directions by moving the thumbstick, and the ability to flick between three preset camera distances by clicking in the thumbstick. Basically just standard camera controls for a 3rd person game, so you don't have to deal with awkward cameras.

    The problem is I have literally no clue what I'm meant to be doing. I've seen all 32 editor vids but something like this doesn't seem to be covered. The object position event doesn't seem to work on cameras, and the camera event doesn't seem to be used to move cameras.

    I'm completely stumped here guys. Halp?
    Share this post

  2. #2

    Re: Need Help With Camera Controls

    From the editor's pause menu look in the example tracks for the one with the first person controls... Load it up and start poking around to see how it works.
    Share this post

  3. #3

    Re: Need Help With Camera Controls

    Originally Posted by thebeardo
    From the editor's pause menu look in the example tracks for the one with the first person controls... Load it up and start poking around to see how it works.
    OK it turns out they used a custom camera. And the object position event seems to work completely fine with that.

    MFW
    Share this post

  4. #4

    Re: Need Help With Camera Controls

    That's how I felt after learning how to interpolate a value the other day.....
    Share this post

  5. #5

    Re: Need Help With Camera Controls

    OK, another quick question. Is there anyway to get a camera to angle itself to always point at a specific object when that object or the camera moves. Basically I want the camera to be able to rotate in a circle around the character, and I'm hoping there's an easy way to make the camera face this character the whole time. It would still be possible without this ability, but it would mean I'd have to use some fairly complicated maths, such as equations of a circle and dealing with angles. And I'd hate to spend all that time nerding out only to find out there was a much simpler way.
    Share this post

  6. #6

    Re: Need Help With Camera Controls

    Originally Posted by James24993
    OK, another quick question. Is there anyway to get a camera to angle itself to always point at a specific object when that object or the camera moves. Basically I want the camera to be able to rotate in a circle around the character, and I'm hoping there's an easy way to make the camera face this character the whole time. It would still be possible without this ability, but it would mean I'd have to use some fairly complicated maths, such as equations of a circle and dealing with angles. And I'd hate to spend all that time nerding out only to find out there was a much simpler way.
    So I'm guessing nobody has any ideas on this? I just need to know if it's possible or not. If not I would still appreciate a reply so I can just get started with the complicated way.
    Share this post

  7. #7

    Re: Need Help With Camera Controls

    Can you apply a force to a custom camera to make it orbit your object? I thought there is a setting to make the camera always look at an object.

    I haven't played with cameras much so I"m just guessing.
    Share this post

  8. #8

    Re: Need Help With Camera Controls

    Originally Posted by thebeardo
    Can you apply a force to a custom camera to make it orbit your object? I thought there is a setting to make the camera always look at an object.

    I haven't played with cameras much so I"m just guessing.
    Found it.

    Still need to sort out the orbiting side (it does respond to forces) but at least the rotation aspect is sorted. Thanks.
    Share this post

  9. #9

    Re: Need Help With Camera Controls

    James - did you get your camera orbit to work?
    Share this post

  10. #10

    Re: Need Help With Camera Controls

    Originally Posted by thebeardo
    James - did you get your camera orbit to work?
    I'm getting there. I'll explain how I did it, if you're interested, as it's probably a useful technique.

    I went down the "nerding out" route (Mother of God. It's complicated). Basically I used an object position event. But what I had to do is work out that if you have a circle orbiting a point (the game character), then the distance between the game character and the camera is the radius of the circle (pretty obvious).

    From there, I had to use a bit of trigonometry to work out that the coordintes of any point of the circle can be found be using sin curves. When the X sin curve is at a maximum point the Z sin curve is at a minimum. So after setting up these sin curves, on a loop, linked to respective object position events, with offset ticks set to one, and the maximum and minimum values set to the radius (basically more nerdy math derivations). After that, I got a camera which periodically orbited around the player in a perfect circle. Stage one completed.

    Next, I had to assign some controls. The problem here was that, while moving the camera clockwise via button triggers (Just a button trigger, the sin curves, and a few state events), I couldn't get it to move clockwise, as you can't get a curve graph to move in reverse so easily. So instead, I deleted the button triggers and state events. Added two linear curves for each axis, and set the button triggers to activate and deactivate these instead. Then had an operation which subracts one from the other, so moving right stick right increases the "positive" graph, moving it left increases the negative. Then I had a subtract operation to find the overall value from these. Next, I set this to be the offset ticks of the sin graph. So I now had a sin graph which moves in both directions.

    One more problem from there, was that you can't have negative offset ticks, so I added an operation to add a cycle's worth of ticks to the overall value from the 2 linear graphs if the value ever went below zero.

    And this is where I'm up to now. I now have a camera that can be fully rotated across TWO axis. I still need to do the zoom feature (Thinking data sources which increase or decrease the max and mon valiues of the sin graphs, combined with yet moar trigonometry) and then finally allowing you to rotate about all THREE axis (not a bloody clue about this atm).

    Thanks for your help so far. Much appreciated

    TLR: Bits of brain matter now reside on my wall.
    Share this post