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"

How to switch to another camera component without deactivating others?

I have multiple camera components in an actor. How can I switch to a different camera component within an actor, without deactivating other camera components?

There is an answer that deals with this by deactivating all other camera components within the actor. https://answers.unrealengine.com/questions/45130/switching-between-multiple-characters-within-the-c.html

Unfortunately, this is not the solution I expect, because I need all camera components activated (they are bound to other widgets, like minimaps or car rearviews).

For example, I have two camera components, one for front view (main), and one for rear view. When I start the game, the rear view is displayed on screen, whereas the front view is expected. I have no idea how to switch to the front camera to display on screen. Thank you very much!

Rear view on screen? Camera components Front and Rear cameras

Product Version: UE 4.20
Tags:
2.png (774.2 kB)
4.png (9.5 kB)
5.png (127.8 kB)
more ▼

asked Aug 19 '18 at 06:00 PM in Rendering

avatar image

Fan.JIN
10 2 2 6

avatar image Everynone Aug 20 '18 at 11:41 AM

Do you need to just switch between the components or do you want to switch between them and have the Set View Target With Blend do the interpolation as well?

edit: Let me clarify - Set View Target With Blend is only good for switching between actors - the camera component & actor interaction is pretty dumbed-down so you won't be able to achieve the desired behaviour in blueprints only.

If you want to smoothly switch between camera components withing the same actor, interpolating location between previously set anchor points is a much better solution.

avatar image Fan.JIN Aug 20 '18 at 06:42 PM

Thank you for your clarification. I don't need the "with blend" feature, i.e., I don't need a smooth switch. I just need to switch. But the only way I've found so far to switch camera components within an actor, is to deactivate other camera components in the actor.

My question is, is there another way to do so without deactivating others? I raise this question because I need other camera components for other purposes, so I should not deactivate them.

By the way, I skipped this and worked it around by using a separate Camera Actor attached to the actor, instead of using a Camera Component. This works, but not so convenience as using a component.

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

1 answer: sort voted first

You will not be able to achieve what you want because of how actors calculate which camera component is Active. Set View node just queries the actor and gets the first active camera (a bit of a mystery how this is calculated, I need to find it in c++, perhaps it's small fix).

So no, you can't do it, not in pure blueprints. Especially that you need the rear cam active at all times.

By the way, I skipped this and worked it around by using a separate Camera Actor attached to the actor, instead of using a Camera Component. This works, but not so convenience as using a component.

If you mean a Child Actor Component, then that'd be the bast way to go about it as they spawn and destroy actors automatically. That would be elegant enough for most cases.

more ▼

answered Aug 20 '18 at 08:08 PM

avatar image

Everynone
12.2k 71 24 49

avatar image Fan.JIN Aug 20 '18 at 08:36 PM

If you mean a Child Actor Component

I mean a Camera Actor. I create a Spring Arm component in my Car actor, and then attach the Camera Actor to the Spring Arm component by using "Attach To Component" in blueprint. This works as expected.

Thank you very much for your answer! You save me a lot of time by directly answering no. Thank you

avatar image Everynone Aug 20 '18 at 08:41 PM

I see. If you're still not fed up with setting this up, do consider Child Actor Components. You set them up as components of the car (just like cameras, with positions, rotation and offsets) and choose an actor class for them to use. You already have a camera actor, so you can use that.

This way you do not have to spawn or attach anything. They essentially turn actors into components.

Good luck with the rest!

avatar image Fan.JIN Aug 20 '18 at 08:58 PM

I'll try your suggestions and see which approach seems best. Child Actor Component seems powerful. Thank you

(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