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"

Change View on clicked object

Hi Guys, we want to make a main-menu without the classic button style. Instead we want to use the environment as our menu. Much like Driver, for example we want to exit the game when clicking on the door. ClickedOn as a event which should start the action. We placed leaderboards on one wall of our map, in front of them we placed a camera. This camera should be activated when clicking the leaderboard. Does somebody know how we can do that? Even with a normal click on a menu-button, the camera is not changing to another camera. I used the following answer for that: https://answers.unrealengine.com/questions/298895/how-to-change-cameras-by-umg-button.html Thank you guys.

Product Version: UE 4.10
Tags:
more ▼

asked Jan 27 '16 at 03:14 PM in Blueprint Scripting

avatar image

t3mr0i
3 1 1 4

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

1 answer: sort voted first

The way camera system works in UE4 is that PlayerController, which has CameraManager has set so called view target. That view target is a actor that should be viewed and camera manager ask that actor on every frame how it like to be viewed (it directly ask about camera position) by calling CalcCamera function, which by default picks first found active camera component inside it self and sends back it's world position as a camera position:

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/AActor/CalcCamera/index.html

You can change that behavior by overriding that function in C++, but sadly you can't do that in blueprints. So in blueprints you need to utilize fact that it uses first found camera component, so use camera component in actor and it will be used when actor becomes view target, if you have multiple camera components activate and deactivate them to switch between them. UE4 got simple CameraActor just with camera component alredy made, so you don't need to create empty actor with camera just to have independent camera.

To set view target you use this node (you seen it in that other question you linked):

https://docs.unrealengine.com/latest/INT/BlueprintAPI/Game/Player/SetViewTargetwithBlend/index.html

It has bland function so if you set camera right you don't need to use any matinee to animate it

You also need to keep in mind that by default PlayerController when it possesses new pawn (which also include on start of the game) it will automatically set it's view target to possessed pawn, you can disable that by setting boolean in PlayerController "Auto Manage Active Camera Target" (you can set that in defaults, should be in "Player Controller" category)

more ▼

answered Jan 27 '16 at 04:53 PM

avatar image

Shadowriver
37.2k 936 172 1116

(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