x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Is it possible to set the left mouse button to click and move location on the scenery, and use the mouse right to just turn the camera 360 degrees(rotation)?

Good afternoon friends, I am currently developing a project in Unreal where my client will view the product in the first person view, my question is the following, it is possible to set the left mouse button to click and move location on the scenery, and use the mouse right to just turn the camera 360 degrees(rotation)? I tried the top down mode but I can not set the right mouse to look around! Thank you

Product Version: UE 4.20
Tags:
more ▼

asked Oct 24 '18 at 05:28 PM in Blueprint Scripting

avatar image

Novoas
1 2

avatar image Detilium Oct 24 '18 at 05:42 PM

Are we talking C++ or blueprints?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

This answer is only in regard to the rotation of the camera, not the left-mouse movement

Talking blueprints, you can create an input action for panning (this is where you'd create your mapping to right mouse button). Refer to the image below.

alt text

NOTE: You can set the input actions by pressing Edit->Project settings. In the window, press Input on the left pane. Add the action mapping by pressing the + (I don't know how much you know about UE4).

With this action mapping, you can listen on the click event. From here you can use the Mouse X and Mouse Y events, to get the axis value.

alt text

With the values from these two events, you can define how much you want to move the camera. First, you need to get a reference to the player camera pawn. With this reference you can get the actor rotation, break the rotator, and change the yaw of the rotator. With this new rotator, you can simply just set the actor rotation of the player camera pawn. They say that images say more than word, so refer to this image.

Reference to player pawn alt text

Change yaw on the rotator of the player pawn alt text

This is only for the yaw, but it should be fairly simple to convert this to either the roll, or the pitch if you want that as well.

NOTE: You can easily change the pan sensitivty by adding a multiplier to the axis value. Simply multiply it before change the rotator, just like the image below.

alt text

pan-mapping.png (5.8 kB)
mouse-events.png (15.1 kB)
change-yaw.png (110.2 kB)
pan-sens.png (123.6 kB)
more ▼

answered Oct 24 '18 at 06:06 PM

avatar image

Detilium
71 3 9 10

avatar image PixelOmen Oct 25 '18 at 05:25 AM

This will work, however this seems to be implemented in the level BP. You could also use a character class BP to do something similar in the character BP itself, which would remove the need to get and cast the camera pawn. In this specific case, it's probably not super important which you choose though.

avatar image Detilium Oct 28 '18 at 04:48 PM

This is the player controller, but yes. Controller/character, not super important :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I'm talking about blueprints, the intention is to use only the left mouse button to click and move me on the stage and use the mouse to rotate to view the product while I'm on the stage! Top Down mode only allows me to click on the left mouse button and move but does not allow rotation with the mouse to observe the whole scene.

more ▼

answered Oct 24 '18 at 05:48 PM

avatar image

Novoas
1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Thanks guys for the help, though I did some research and I was able to find a video where it is explained in top down mode, how to use a mouse button to look around and keep the left mouse just to click and move. So after this tutorial i was able to use in 1st Person mode the left mouse to move around (click to move) and right mouse to look around when pressed. I leave the link here https://www.youtube.com/watch?v=MXGp6rgfOyg&feature=youtu.be Cheers

more ▼

answered Oct 25 '18 at 04:32 PM

avatar image

Novoas
1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question