How to Orbit (Horizontally & Vertically) the Camera on Specific World Location

Hello :wave:

I need help on making my Camera orbits on a Specific Location in World. The input will be Left click + Hold + Drag. I already set this up. The only thing I need to do is calculating the new location for the Camera to make it move around, orbiting on that selected part or target. And the Camera should also not lose focus to it.

I also tried attaching the Camera to a SpringArm. Here, the orbiting + rotating is perfectly fine. But, the Camera keeps on jumping to the new location while keeping its distance, but, I don’t want that. I need the Camera to stay put, and when the Left click + Hold + Drag triggers (new selected part location) the Camera will then starts orbiting to that selected part, starting from where the Camera last located in World.

The objective that I need to achieve is similar to the video I attached. Notice the mouse pointer and how the Camera moves around to it.

I am using Unreal Engine 5.2

Hope someone knows the formula or how to setup something like this, and can help me with it :pray:

Let me know if you need additional information.

Thanks in advance!

It’s been a while since I’ve done anything like this but I believe my solution was

While mouse pressed

Interpolate rotation based on last known mouse movement

Mouse movement= Get current mouse position - last mouse position

Or at least something to that effect

camTrack.zip (76.2 KB)

Made a quick example scene

Just be sure to add the custom object & trace channel

pawn setup

Zoom in on point of interest

collision settings for point of interest actor

Custom trace / object channels

Hi,

This is my problem in which the camera reposition or it moves to the new location. I’ve attached a screenshot. The camera’s current location is at the center of the object. Now, if I want to orbit to a new location, the camera should not reposition to its center.

When the Camera start’s orbiting/rotating, it should start from its current location.

If you don’t move the camera then you are going to get a rotation with an offset. It’s not going to be pretty.

Yes, reason for this is all part of my Object are important, like every bit of it, so its not pretty as well if the camera keeps on jumping from one location to another. But I also have the Zoom In/Out and Pan/Tilt view as well, so putting the selected part to the center is still possible.

Where you able to figure out a way of doing this?