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"

Switching between multiple cameras within the Character.

Hey all, I'm looking for simple blueprint functionality for switching between two cameras inside of a character component. I have found a similar post, however the "answers" are not very straightforward and quite confusing. I'll explain what I have been trying. Within the "MyController" blueprint, On Key F Pressed, Switch to second camera. However I can't seem to reference the cameras located within the MyCharacter Components. This is quite a hindrance for me. Can someone explain a bit better how this could be done? thanks in advance!

Product Version: Not Selected
Tags:
more ▼

asked May 18 '14 at 01:28 AM in Blueprint Scripting

avatar image

LocalDose
88 4 5 9

avatar image Pacito100 Sep 26 '17 at 07:29 PM

Thank you !

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

8 answers: sort voted first

Hey dylenbrivera,

If you have multiple cameras within your Character blueprint you want to switch between, you can use the Set Active node that has a boolean New Active to deactivate one camera and activate the other. If you need to call these cameras and functions from outside of the Character blueprint, you'll need to Get Player Character and Cast it to your Character Blueprint, then you can access the cameras with a Get and use Set Active as I mentioned. Here is an example setup you could use in your Controller blueprint:

Cameras

Hope this helps!

-Steve

cameras2.png (189.9 kB)
more ▼

answered May 18 '14 at 02:48 PM

avatar image

Steve Allison STAFF
4.3k 123 58 209

avatar image LocalDose May 19 '14 at 02:11 AM

Thank you for your reply. I'm trying to replicate* the above example, however I cannot find the "Cast To TestingCameras" node. Is this a custom node?

avatar image LocalDose May 19 '14 at 02:18 AM

I see, I was able to accomplish what I was aiming for with the "Set Active" node. Thank you very much Steve, I'm highly impressed with your effort to help me out.

avatar image Ivailo Korakov May 20 '14 at 12:38 PM

Hey man can you post you bluprint you did with the set active node as a image so i can see it. Thank you in advance!

avatar image LocalDose May 20 '14 at 02:06 PM

Sure Ivailo, so as you can see in the following screenshotimage, I have both cameras located inside this same character blueprint. I made a custom event which would can be called to change the cameras when needed. Pay close attention to the use of the disabling and enabling of cameras with each "Set Active" node. First, the active camera must be disabled. Second, your new camera must then be enabled. For the flip, reverse the effect. This works well for me, and does swap the camera. However I haven't been able to successfully blend the transition like when the "Set View Target with Blend" node is used. If anyone reading this has a solution, please let me know. Glad to help out Ivailo!

screenshot.png (199.9 kB)
avatar image DizzyWes ♦♦ STAFF May 20 '14 at 04:15 PM

Hello,

Jumping into the conversation with an additional method of handling it. I added an ArrowComponent to my character Blueprint below for reference.

alt text

In the Graph, I used a FlipFlop like you did but I set the default location of the camera (over the shoulder) prior to starting a Timeline (3 seconds) which is used with the VInterpTo node to blend it smoothly to the new location which is my ArrowComponent (AltCamera).

alt text

When F is pressed again, it executes a similar sequence except it uses the Timeline/VInterpTo process to blend down to my DefaultCamera I set before.

Plenty of ways to handle this, this is just another approach. :)

Edit: This is just reference, you may need to add a branch to check if the camera is in the process of transitioning already and move up or down depending on the direction it's currently moving.

Hope this helps,

-W

arrowcomp.png (158.4 kB)
smoothswitching.png (264.0 kB)
avatar image LocalDose May 20 '14 at 04:23 PM

This is fantastic, I actually tried a similar method about two days ago but was unable to work it correctly. I used an invisible sphere instead of an ArrowComponent but I see how the ArrowComponent would work better. This community is amazing. Thank you guys!

avatar image LocalDose May 20 '14 at 04:51 PM

Wes Bunn, The "ToBird" and "ToPlayer" nodes appear to be some kind of custom vector nodes. Can you share a bit of information on what you did to create/call those nodes? EDIT* I now see that what you did was create a custom timeline(Add Timeline). Took me a moment but I got it.

avatar image DizzyWes ♦♦ STAFF May 20 '14 at 05:53 PM

No worries. Let us know if you need help with the branch setup to check if the camera is in the process of moving to a new location as I could see how that might through a kink into this setup.

-W

avatar image jmalaska Mar 28 '15 at 06:16 PM

Hi Wes -- I'm trying to figure out how to interp back to the base camera now.

Also I've been having problems getting the setup you posted to work. Here's what I have so far:

alt text

I'm not sure why yet, but the camera pops on the initial keypress down but only a few cm. On release though it moves up into the sky. My timelines are set with the Movement track and a key at time 0, value 0, and another key at time 1, value 1. How should I be setting the delta time variable?

Is there a way to possibly do this with Set View Target with Blend inside the character BP? That would be ideal. But it looks like it's only usable on the level BP? https://answers.unrealengine.com/questions/13312/how-to-temporarily-change-player-camera-to-externa.html

avatar image jitaikLim Apr 15 '16 at 09:26 PM

Hi jmalaske,

I know this is a super late answer and you probably know that how to add 'delta time' in the character BP.

For future reference, you can add delta time by creating Tick event in the character BP. Once create Tick event which has a float name as 'Delta Seconds' promote this and put the name whatever you want like 'delta time' and use this. :D

avatar image Gunnar0 Apr 14 '15 at 01:57 AM

How did you get the "Set active" nodes from the earlier screen shot you posted, where it says "Target it ActorComponent" below the title?

avatar image Gunnar0 Apr 14 '15 at 11:38 PM

Never mind i found out, but this was very helpful. †ℌαηḱṧ‼ (Alt code word)

avatar image Amaresh Dec 06 '14 at 04:01 PM

@Wes Bunn I've tried your solution but I have few questions:

First, why are you adding the movement vector from timeline to the result of vinterp. Isn't it the final position?

Second, I tried a side view camera instead of a bird view. But, when the camera reaches the side angle it starts rotating in all kind of directions. How to fix that?

If you want to have a look at my blueprint setup, I can show it to you. But please help.

Thanks you.

avatar image leofucci Mar 31 '19 at 05:05 AM

I have the same approach but now I would like to blend transitions between cammeras, how can I do this? (cammera is not in the map, it is also tied to the character)

avatar image aNorthStar Mar 31 '19 at 05:24 AM

yep, it's certainly possible.. take a look at the link below posted by @saeedc... you'd use this approach when you need to SMOOTHLY blend between cameras

basically instead of Camera Components (maybe at the end of Spring Arms) directly on your character you'd use Child Actors (maybe also at the end of Spring Arms) with Camera Components and use Set View Target with Blend to switch between the (child) Actors (maybe just with a camera component, nothing else)

avatar image leofucci Mar 31 '19 at 02:48 PM

Doesn't seem to fit, I have an actor with 2 cameras, 1st person view attached to head, 3rd person attached to spring arm. I want to switch from 1st to 3rd view. As far as I understand, "SetViewTargetWithBlend" does not work within same actor, the idea is to switch actors, so camera will blend to a second (different) actor's camera. Parameter "NewViewTarget" does not allow to set which camera, type mismatch, and If i set myself (but previously change active camera) it warps because of the activation.

avatar image aNorthStar Mar 31 '19 at 03:08 PM

yes... instead of 2 Camera Components use 2 Child Actor Components instead... on the Child Actor add a Camera Component

Set View Target with Blend works with Child Actor Components...

If you are still struggling with it, the process is described in a bit more detail in a link on this thread and elsewhere on the forum

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

Just to update this to what I think may be best practice:

To blend smoothly between two cameras within the player pawn... I'd use the simple link provided by Saeedc above

To switch instantly between two cameras within the player pawn... I'd suggest the following way:

alt text

Also remember to set your default camera component Auto activate switch to ON and your secondary camera Auto Activate switch to OFF (either in the component settings or using BeginPlay).

alt text

For completeness, if you are using two spring arms, you can toggle them on/off too. Remember to set both Auto activate up as with both the cameras. alt text

togglecam.jpg (86.0 kB)
untitled-2.jpg (585.6 kB)
toggle-3.jpg (126.1 kB)
more ▼

answered Nov 14 '17 at 06:22 AM

avatar image

aNorthStar
1.1k 9 17 20

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

For anyone else - Here's a simple way to switch cameras from the level blueprint, and casting a camera that's in a Pawn blueprint.

Don't forget to have the camera attached to a boom in the Pawn blueprint.

cameracasting.png (209.9 kB)
more ▼

answered Oct 08 '15 at 11:24 PM

avatar image

Razivoid
76 1 5 5

avatar image leofucci Mar 31 '19 at 02:52 PM

Are you switching cameras within same actor here? CameraActor62 looks like inside map, right?

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

Or just that alt text

capture.png (99.0 kB)
more ▼

answered May 13 '17 at 04:38 PM

avatar image

Locoboy_
11 1 3

avatar image MTK23_CZ Feb 22 '18 at 08:08 PM

I was not aware about Toggle Active - was using Activate/Deactive - so thank you, sir.

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

answered Jun 27 '17 at 05:24 PM

avatar image

saeedc
2.4k 73 43 108

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

not sure if this would help but i put a tutorial on a simple camera location switch that can be activated on the press of a button and a return to default on release.https://www.youtube.com/watch?v=v1Pe1_8soPQ

more ▼

answered Apr 27 '15 at 08:38 PM

avatar image

Primest
0 5 7 8

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

you can also do what I have been testing and move one camera on a arm to different locations by changing an enum

so first person view might change arm length to 0 with a 0,0,0 rot, and third person would have an arm length of 650 and a rot of 0,-40,0 and using a timer you can slowly move the camera in and out, or even using the scroll on you mouse make a smooth transition.

then first and third become one camera, and top down would be just as easy at a 0,-90,0 rot, and the only difficult parts would be shoulder view where you might set a second camera, or use a larger blueprint to turn camera, and the arm.

more ▼

answered Apr 10 '17 at 03:38 PM

avatar image

Lemosla
3 1 2

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

Thank You, NorthStar. Simple clean and working switch for 2 cameras. Before, I was confused while using toggles with two cameras, both on springs, they acted super weird. Looks like problem was simply that I need to toggle both - camera and spring arm. This is good for instant switching. I wonder, what is considered best elegant way for switching two (or more) springs-cameras with smooth "cinematic" transition from one to another? Or, there should be just one spring+camera and all variations in spring parameters? Thanks in advance! :)

more ▼

answered Dec 18 '17 at 10:44 PM

avatar image

Thunder_Owl
11 2 3

avatar image aNorthStar Feb 23 '18 at 05:34 AM

hi @Thunder_Owl, sincere apologies... I somehow missed your question... I hope it isn't to late to give you a useful response :)

the accepted way to smoothly and cinematically transition between 2 cameras is Set View Target with Blend. It switches between actors and automatically finds the active camera (yes, it's a bit confusing initally)

However, using this node to switch cameras components that are within a pawn/character/actor involves using a Child Actor component... it's a tiny bit of a workaround, but afaik it is the accepted approach... the link is above in the response of @Saeedc

As you mention, depending on your needs, you could also just use one spring arm/camera and move it into position by using Spring Arm Offset and Target Offset, also turning on/off controls/lag etc as you need to. I don't think either way is more correct in this instance... it just depends on what looks right for your purposes :)

(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