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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to create a fixed main camera through C++

Hey guys,

So, I've been browsing the unreal engine 4 documentation for hours tonight just to try and comprehend the camera workflow of the engine. Unfortunately, while it does make me feel stupid, I can't seem to fathom the camera workflow AT ALL. The documentation seems so vague to me on many points.

Here's the deal:

I'm attempting to create a very simple game. All it needs is a fixed camera looking down upon a scene where the player can then run around with a character. The camera and controllable character is not associated in any way. The only problem is, after having attempting for hours, I have no clue how you even make such a simple fixed camera just looking down on the scene through C++ coding. How do you go about doing this? Any kind of pointers would be wonderful.

I would like my level to have a fixed camera actor that's just simply part of the level, and then upon game start, my C++ code should simply set that camera as the one it should view from. From what I've been able to understand it is the PlayerController that handles the current camera view? I attempted to use "SetViewTarget" with no luck.

So, I suppose what I'm asking is first and foremost how the "best practice" would be to set up such a fixed camera through C++ code. I need to see how this kind of workflow is done in Unreal, I'm completely lost even for such a seemingly simple task!

Thank you all for your help :-)

Product Version: Not Selected
more ▼

asked Aug 08 '14 at 02:31 AM in C++ Programming

avatar image

8 2 3 6

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

1 answer: sort voted first

One hack would be to add a camera component to your pawn and make its transform absolute (relative is the default). That will make the camera fixed and it will not follow the pawn anymore. Here is a similar question: https://answers.unrealengine.com/questions/42941/rts-camera-1.html

more ▼

answered Aug 08 '14 at 03:07 AM

avatar image

3.4k 154 51 271

avatar image Beagle Aug 08 '14 at 10:17 AM

Thank you a lot for the suggestion :-) I will try this out, though it seems to be a completely reasonable way of doing it that should work. Thank you!

avatar image mindfane Aug 08 '14 at 11:01 AM

Let me know if you need any more help

avatar image Beagle Aug 08 '14 at 11:10 AM

Thank you :-)

(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