Home Unreal Engine

How do I make the camera Orbit an object?

Hello.

I am building a set-piece, where my camera is meant to orbit the centre of the enviroment, in relation to the players position.

I am working in kismet, and the problem I am having is that there does not seem to be a way to find A-Tan.

This Is what I have.

Node Set 1: Attached the Camera to a Ball in the centre of the level.

Node Set 2: Attached a DynamicTriggerVolume to the Player.

Node Set 3: GetLocationandRotation of both Centre Ball and DynamicTriggerVolume as vector.

The problem is now, that I do not have a way to use these vectors to find the difference in rotation, to there after position the camera in the new location, facing the centre once more.

I also built a matinee for the central Ball, spinning, to make sure the camera could track it, which was fine, it goes around smoothly. Might there be a way to compare the matinees progression in relation to the players location otherwise?

All help is appreciated!
Thanks

Replies

  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    Assuming I understood that correctly, the idea is to keep the player inbetween the ball and the camera, with the camera at a fixed/known distance+height from the ball, yes? If that's the case, you could simply get the x/y vector from ball to player, normalize, and then multiply that by your known distance, then alter height as needed.
  • AslanTech
    Options
    Offline / Send Message
    Yea, that is what I want to do. But how would I normalise the coordinates within kismet?

    Might there be a way to fix the ball on its position, and only track the player along x/y? Considering that the matinee actually shows me that I just need the ball to rotate along with the players position?
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    Whoops, sorry, I haven't really worked with Kismet much, and just assumed there'd be basic vector and math ops available. You could do up some custom Kismet nodes (unrealScript), though I'm not currently too familiar with the process for that.

    This should work. I haven't done it up in Kismet, but the nodes are available:

    d = Player Distance from arena center
    p = Player position
    c = Camera orbit radius
    CameraPosition = p * (c / d)

    So you should only need a position/rotation node and a distance node.
  • PointlessReboot
    The nodes you want in this case are:

    SeqAct_GetDistance - Gets distance from A to B
    SeqAct_MultiplyFloat - Multiples A and B and returns result
    SeqAct_DivideFloat - Divides A and B and returns Result
    SeqAct_GetLocationAndRotation - Return Location and Rotation of target

    All should be available in UDK, you might want to checkout
    https://udn.epicgames.com/Three/KismetReference
Sign In or Register to comment.