drag the mouse to let a camera around an object 360 rotation

I want to achieve this function: drag the mouse to let a camera around an object 360 rotation. What should I do?

I want to achieve this function: drag the mouse to let a camera around an object 360 rotation. What should I do?

Hello! I was looking for this weeks ago, and with some body’s help I could built the controller i was looking for. Basicly you will need to create 2 blueprints. The first one should be the Character Blueprint, and inside the components you should create a ‘‘Spring Arm’’ and attach the camera to it (drag and drop the camera to the Spring Arm). Also make sure to increase the spring arm length and enable ‘‘User Controller View Rotation’’ in the ‘‘Camera Settings’’ of the Spring Arm detail panel.

Ignore the sphere (I used for other purposes)

Ok, now create a new blueprint that would be our Player Controller Blueprint, give it a custom class, type: PlayerController (this is IMPORTANT). After create it, go to Graph, Create 1 variable name it: “Mouse Press”, and the type should be “bool”.
Follow the picture to built your mouse controls (if you want the mouse cursor to disappear while mouse button pressed add those two last variables in the picture called ''Show Mouse Cursor", just drag a node from the “Mouse Press” and type “Show Mouse Cursor”),

Now in that same blueprint, go to defaults and enable all boxes inside the ''Mouse Interface" section.

And finally, go to your game mode blueprint and set the ''Default Player Class" to the Character Blueprint you created and the Player Controller Blueprint to the ‘‘Player Controller Class’’

thanks for posting this! turning off “use controller rotation yaw” in the character is important too

Alright- I give up! I know this is an old thread (I think exactly a year old?) but I’m stuck- literally!

After following this as closely as I could (first time using blueprint!) my camera doesn’t move. Nothing happens! My mouse however does disappear when I left-click and drag around- appears when released.

Using the build 4.7.1 build.

This seems sooo “simple,” but I guess to someone totally new there’s bound to be something I’m not seeing. Great tutorial though- good example of how easy blueprint will be to use once I get the hang of it!

Thanks!

Hello there :slight_smile:

You can download this free project I created one year go for UE4 learning purposes, it has this code inside the mouse_controler blueprint. Or try it reverse engineering to figer it out. I’ve been there one year ago, but its not unsolvable as you can see :slight_smile:

I hope it helps.

I believe the first answer is right, but overlooks the critical part where you setup the inputs in the Project Settings. This video covers this. I’m doing the same thing right now myself and had to look up this video as a refresher. Basically, it’s a dumb, 3rd person character without the ability to move. He’s just stuck there, with a camera spinning around him.

Thank you very much,and the shpere that around the camera is used to crash sth?

Thank you very much,and the shpere that around the camera is used to crash sth?

This works great! thanks! I did however notice a small bug, for some reason, if I use the right click on the mouse it stops the function of the orbit, any idea why this caused it to stop working?

Here’s a smaller project with mouse rotate about point, or in android VR it acts as a swivel chair orbit.

…it is SO annoying that nobody has a detailed step-by-step explanation of how to do this correctly. you may watch thousands of YT-tutorials and even epic-games own channel but never get any information of HOW TO DO this to make it run.

so - all in all i have to say - after 2 whole days of trying to get this “tutorial” work: it does NOT.
UE is such a big waste of time.

…this isn’t simple in any way. UE is way too unlogical here. i spend two days to find out how to use these nodes but it doesn’t work. better keep on learning by trial and error (well, which takes a lot more time) than watching fancy YT-videos or trying to believe in answers like this thinking it brings you to the point.

this “tutorial” is false. it does not work cause a ton of information is missing.

Sorry to hear your frustrations - but it’s not trivial and only a portion of humanity codes computers - so keep calm - carry on !

@DigitalCoreGraphics How long have you been using @UE4 ?

First of all: Thank you very much for your response.

Well, frustration goes on for a long time now with UE. Starting early 2015 the engine was installed and deinstalled every 4- 6 weeks because of situations like

“WTF!? No! I do not waste my time any longer with this!”

and then:

“…hm… let’s give it another try”

but it still remains the same. This forum and even YT videos from Epic doesn’t help combining stuff. You need someone who explains this to you and how this strange piece of Software works. I mean, Epic wants user to understand how to use this piece of software, isn’t it so? Even Crytek does a better job in explaining how to use their engine…

Thinking of that I’m a user of 3dsMax/AFX/Fusion/PS and Nuke to get my Freelance work in Arch- and ProductVis done made me believe that i could handle UE somehow… WHAT. A. GREAT. MISTAKE.

The only thing i need to know for the beginning:

How is it possible to orbit a camera around a simple box (for example)?
What do i need to do?

I want to move around it with mouse or keyboard-actions in a fixed distance.
After this is done the next step should be using the scroll-wheel/ keys to zoom in.
And after that the oribiting should be capped at 180° so that you only can move to the side of the object and not to the back.

I now that i have to keep things simple at first - but to have this you’ll need to know how to get things work…

Here’s the scene:

http://www.digitalcoregraphics.de/clients/UE4/Scene.jpg

And the “Blueprint” for the SpringArm…

http://www.digitalcoregraphics.de/clients/UE4/BP_SpringArmCamera.jpg

Don’t know if this helps - and also i don’t know how to move forward with this now.
What steps and complicated combinations are needed to move a camera around the handle that you can see there?
Do i need to study C++ several years?
Do i need a team of 5-10 people to realize a simple scene like this?

:wink:

Hello!
For sure UE4 can be frustrating sometimes, its a complex software and alot to get your head around. This is how I would set up a system like this.

  1. Create a GameMode (GM), PlayerController (PC) and Pawn. I’ve Named them Rotate_GameMode etc…
  2. Set the default values of GameMode, PlayerController and Pawn in the World settings
  3. In the PC, under Mouse Interface, Set Show Mouse Cursor, Enable Click Events to True.
  4. Possess the Pawn on Event Begin Play (see picture Posess)

In the Pawn.

  1. Make sure the Pawn has Auto Posess set to Player 0.
  2. Set up the components seen i picture below. The SpringArmLength is set to 300 as start value
  3. Set up the three custom events for Rotation, Zoom and Pitch (for exampel)

123932-pawncomponents.png

The value for “Zoom Step Length” is how many Unreal Units you will travel for every mouse wheel step.

PC-setup will follow in comment due to Upload Limitations

In the PC:
To read the values of the mouse. On Tick you set up the PC to read the mouse values and execute the Custom event inside the possessed pawn as seen above.

The Speed Variabels is how quick the rotation will be, feel free to modify for it to fit your needs.

For zoom you simply want to drive the Zoom Event inside the Pawn. I send in a boolean to sort out if i Zoom In or Zoom out. I bind them like picture below.

Hope this will help you with the case. Feel free to ask questions.
And mark it as Resolved if it solves your question.

Cheers!

Trying to keep this step by step now…

What do you mean when you say:
“Create a GameMode (GM), PlayerController (PC) and Pawn.”

Where? There we have Pawn, Player Controller and Game Mode Base?
I really can’t figure out how to press all three at once… :frowning:

http://www.digitalcoregraphics.de/clients/UE4/blueprint_selection.jpg

It’s three different Blueprint Actors. So Create one each. eg

  1. Create Actor → Game Mode → Name it something good
  2. Create Actor → Player controller → Name it something good
  3. Create Actor → Pawn → Name it something good

THANK YOU!

You see: If these basic-infos are missing you’re totally lost!
How can you know that from scratch?

Moving on now…