1. #1

    Making a camera turn using analog sticks

    Hi I've been having problems making a camera follow my custom character (ball). I need the camera to turn left or right in order to make to follow the map. If theirs a way please sent pictures or link a video.
    Share this post

  2. #2

    Common
    Physics tools > Object glue tool
    Glue that to your camera and set the pivot point to the center of the ball.

    Bring out these:
    Triggers > Interval trigger
    Events > Object Position event (OPE)
    Operations > Two-input operator
    Data Sources > Game variable data source
    Data Sources > Vector Object Info

    Vector Object Info
    Target = ball

    Interval Trigger
    Delay: 1 tick
    Target = OPE

    Object Position Event
    [x] Move
    XYZ = Vector Object Info
    [x] Rotate
    Yaw = 2-Input Operator
    Target = Camera group Pivot point

    2-Input Operator
    Type: Multiply
    Target1 = Game variable data source
    Target2 = 1.50 (set this to negative to rotate the camera in the opposite direction)

    Game variable data source
    Type: Right Stick Horizontal
    Share this post

  3. #3
    Got it to wiggle sighty but, still not working right. Has something to do with the Object Position Event, what do you mean by [x] Move? I put a picture
    https://drive.google.com/open?id=0B8...Vo0QW5xRFdqV1E
    Tue_Sep_22_19-21-09_PDT_2015.png
    not really sure how to share lol
    Share this post

  4. #4
    Oh I'm sorry, I gave out incomplete instructions :P.
    You also need a Set Variable Event and a Variable Data Source

    At the bottom of the OPE is Event/Target. Send that to the Set Variable to trigger it.

    Set Variable Event
    Type: Increase
    Value = 2-Input
    Target = Variable Data Source

    Object Position Event (updated with comments)
    [x] Move | The checkbox that enables movement, set to filled in.
    XYZ = Vector Object Info
    [x] Rotate | The checkbox that enables rotation, set to filled in.
    [x] Set Rotation
    [x] Local | Otherwise you have to mess with world coordinates which look wrong past 359 degrees
    Yaw = Variable Data Source
    Target = Camera group Pivot point
    Event/Target = Set Variable Event

    Variable Data Source
    Set [x] Interpolate if you want a smooth rotation
    Share this post

  5. #5
    Camera does rotate left and right now
    XYZ = Vector Object Info is an issue. You want me to have X Y and Z to be connected to the same vector object info?. Trying that makes it jump to random spots lol. Whatever makes the camera follow the ball is the problem now.
    https://youtu.be/jq3sG1bXAEk Here is a YouTube video of it.
    Share this post

  6. #6
    The Vector Object Info targets the ball. In the video you have it targeting the camera group.
    The OPE's Move XYZ targets the Vector. You have it unset.
    So the camera moves to the position of the Vector, which is the ball.
    The [x] Local should only be selected for Rotation. not Move.
    Share this post

  7. #7
    Thank you works great now!
    Sorry that you have to keep helping me
    Any camera settings that will make to stop resetting when the ball moves forward? I move the camera then it goes right back to default spot. It follows and turns(not smooth yet)
    "Set [x] Interpolate if you want a smooth rotation" anything else that might help?
    I'll make a Full YouTube video to help others with this and I'll give you credit when were done lol
    Share this post

  8. #8
    If you are using a Custom camera (yellow) it shouldn't be resetting. Unless there is something in the code resetting the rotation angle to 0. If you're using the default blue camera, maybe setting it's position to Static instead of Driving Line?
    Share this post

  9. #9
    https://www.youtube.com/watch?v=SLVelsVXbks You can Always follow My Guide For My way Of Doing it. It's A 3rd person ball game with the right sticks to turn the camera left & right.
    Share this post