how can I make an object rotate when dragging mouse in another object

Hi I think this is more of a me not knowing much math issue but anyway, I’ll try to explain as good as I can.

I have this object on my level

the thing that is currently being seen on the screen is a scene capture component, I want to rotate that cene capture component when the user drags the mouse over the game’s computer’s screen. like what tablets or phones do when you zoom on a photo, that thing when you can move the photo around in gallery when you zoom it, the more you zoom the more you can move, I want to achieve the same effect here I already made the zoom part, changing the fov of the scene capture component, but I don’t know how to do the drag part (the dragging should only occur when dragging over the screen).

1 Like

i’d suggest you actually move the scene capture comp or the root instead of changing the fov. forward/backward is analogous to zoom, and sideways and up for panning.

while it would change how it looks, it would behave more consistent.

also a zoom wouldn’t change the fov, but scale, so it makes sense.

otherwise just scale the and pan the texture that you use to display the render target. that will look more accurate. it will pixelate, but that’s exactly what you would expect from a digital zoom.

Drag to rotate Object in Another Actor :grin:

Sorry, I think I didn’t fully explained this. I did consider that, but I discarded the idea since I need the rotation of the object containing the scene capture component to be the one to rotate (that object is not the computer shown in the image is another thing), but I need to zoom without moving the screen capture component from where it is, so no, unfortunately that solution does not work for me.

Hi, could you please elaborate more on your answer?

that account is llm spam, i’m confident. it just sumarizes and repeats what’s been discussed.

sorry i really struggle to visualize that. could you put a picture or example of something similar in other games?

you can still zoom using the fov, and rotate moving the capture component if you use a good enough math, i think.

I cannot find a game that does exactly what I want, I want to make the screen capture component when I click and drag on the screen of the game’s computer.

I got it working by my self, here is the code if anyone needs it
use this to calculate the desired rotation

and use this to apply it

this is how it looks like

1 Like