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"

Custom viewport navigation

I'm working on an top down game. The best way to edit and work with top down maps would be a function to pan and drag the viewport camera to the part of the map that needs attention, just like dragging the camera in an mobile game. Unfortunately the only way for the editor controls to move on such a xy-plane would be to press the left mouse button and drag forward to dolly and sideways to rotate, but this behavior is not really ideal. So for usability purposes I want to change the default "dolly" behavior and implement a more useful "camera drag" function. I'm sure this can't be done via plugins and requires engine changes, but for me the benefit it provides would outweigh the inconvenience.

So, my question is this, I've dug into the engine a couple times but finding what I'm looking for is still quite difficult. Does anyone know (or have a tip) how I can find the location where viewport camera movement is handled within the editor?

Product Version: Not Selected
Tags:
more ▼

asked Apr 20 '15 at 09:31 PM in C++ Programming

avatar image

ChrisBernal
31 3 5 10

avatar image kostor Apr 21 '15 at 10:17 AM

I don't quite understand why do you find it difficult to pan with your mouse. But anyways, a tip: debug your game (launch trhough VS, not EPIC Launcher) and breakpoint the line of camera movement. When it reaches it, follow it to a journey to the inside of the engine!

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Thank you, I was able to find the code and make some adjustments. For anyone else interested, you have to edit the "EditorViewportClient.cpp" file and replace

 InDragDelta.X = InDelta.Y * FMath::Cos(ViewRotation.Yaw * PI / 180.f);
 InDragDelta.Y = InDelta.Y * FMath::Sin(ViewRotation.Yaw * PI / 180.f);
 InRotDelta.Yaw = InDelta.X * ViewportSettings->MouseSensitivty;

with

 InDragDelta.X = InDelta.Y * FMath::Cos(ViewRotation.Yaw * PI / 180.f);
 InDragDelta.Y = InDelta.Y * FMath::Sin(ViewRotation.Yaw * PI / 180.f);
 FVector viewVector = ViewRotation.Vector().RotateAngleAxis(90, FVector(0, 0, 1));
 InDragDelta += InDelta.X * viewVector * FVector(1.25f, 1.25f, 0);

That should move the camera in an RTS style. Still wondering if this could be put inside a plugin but it should definitely work for now.

more ▼

answered Apr 23 '15 at 10:47 PM

avatar image

ChrisBernal
31 3 5 10

avatar image kostor Apr 24 '15 at 11:11 AM

Happy I could have helped! So this is for panning, right?

avatar image ChrisBernal Apr 24 '15 at 05:24 PM

Right, I simply disable the camera yaw rotation and replace it with the appropriate left-right movement. Since I just edit predefined functions the panning also reacts to camera speeds and such, which is nice

(comments are locked)
10|2000 characters needed characters left
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