*Not solved yet* Help for rotation with mouse

Hi, so i have been trying for days now and i am about to lose my head over it…

What i am trying to archive is:

  • I want to rotate a object and rotate it along when moving my mouse, just like the unreal engine gizmo rotation does
  • The rotation from the mouse axis can be different because if you move the camera the raw mouse axis doesn’t always have the value to rotate and i can’t seem to know how to calculcte that

If it still doesn’t make sense, take a look at the unreal engine gizmo rotation, you can get a clear idea of what i am looking for.

I really hope someone can help me here.
Thanks <3

Here is my implementation of camera rotation. The camera is connected with the Main Cam Root


The Gate must be connected with the event tick to the Enter

The problem with you code, is that it doesn’t take in count of the position of the camera view from the target object you want to rotate

If it doesn’t get in counted, that means that going “Right” with the mouse would only lead to one direction rotation and not the desiered rotation acroding to the mouse rotation and camera angle from the target object

The unreal engine and unity gizmo for that matter, take in count of where you are looking according to the target object and bases the mouse axis for the rotation correctly (witch is waht i want)

Hope that makes sense

In my case camera position is fixed to orbit around the player

Also, I made a pan mode and rotate the camera around the center of the screen

That has one direction because you move with the camera

If you place a object in a unreal scene and have gizmo to rotation and try to rotate it and then change camera angle and position and try to rotate it exatly the same mouse movement you did
The result should not be the same even tho you rotate the mouse the same way, and thats is the right way

I just can’t seem to know how on earth one would archive that. There is little to zero knowgelde on the internet about it

Yeah, I know my implementation is pretty basic, but it works for my case. I’m using an object to rotate around it even for pan mode. Later I will rework this

I dont think its the same think i am looking for. You are panning around and according to you BP.
Your x axis value always will give you the direction you are trying to move

For and as i explained, that is what i am not trying to do, but rather have an mouse axis be a posetive/negative in the same direction, the value is based on the direction/angle from camera to object (like scene gizmo rotation does)

But i appricate the efford, thanks :slight_smile:

Share if you will be succeeded, it would be interesting to look at

Im 6 days in but no success, im sure its something simple but wow my brain…
Going bald because of this haha

I will share if i get anything to work :smiley:

I know-how was that I spent almost two weeks to find a simple solution that is good enough for the current development stage :grinning:
My game dev experience says me that it needs a lot more to make it great.

Would anyone else know a method on this?

You also might check youtube to get some ideas
https://www.youtube.com/results?search_query=unreal+engine+camera+rotation