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"

Independent camera blueprint setup

Hello world!

Here seeking guidance to a problem I've been having for a while and can't seam to wrap my head around. See in my project we have a third person character that can switch bodies on the spot. Each character blueprint has their own camera setup in them. When the character switches bodies the current camera jerks and jumps to the one on the next body creating an awful visual experience.

Is there a way to create a independent third person camera to look at the character, follow and rotate view? That way when the switch happens the camera stays the same. Or is there a way to make the camera on the main body stay in control?

Any help is appreciated!

Product Version: UE 4.18
Tags:
more ▼

asked Oct 24 '18 at 04:36 PM in Blueprint Scripting

avatar image

D4njo
6 4 7 9

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

3 answers: sort voted first

Hello, i think the best approach will be in steps :

  1. Spawn an independent camera at the location of the character camera when you switch character (create a blueprint actor holding only a camera)

  2. Deactivate character camera

  3. Possess the new independent camera

  4. Make a Timeline in Camera_BP, so you can get a nice switch between two characters (you just need a float curve 0 to 1 in this timeline) alt text

  5. Possess the new Character and Destroy the Independent Camera

Hope this help !

timeline.png (153.2 kB)
more ▼

answered Oct 24 '18 at 10:12 PM

avatar image

Araan95
44 1 2 7

avatar image PixelOmen Oct 26 '18 at 12:07 PM

I like your approach, but the problem comes when you possess the new character. As far as I can tell, there's no way to prevent it from setting the target view to whatever the default camera position is in that BP and there's no way to translate controller input rotations to camera or spring arm relative transforms. I've come up with a workaround below.

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

There are many of ways of doing this, but the simplest most straight forward one I can think of is doing it directly in the player controller BP. I'm not sure how familiar you are with BP, but just to be clear it's not the character/pawn BP, but the player controller itself.

In theory it should actually be cleaner than this, but it turned out to be huge headache because I think there is a bug that changes the player camera view target every time you possess a pawn, even if you disable automatic camera management. Anyway, I found a workaround, the BP below should work.

The key things to take note of are how I am creating a dummy spectator pawn with no collision to store the transform of the character being swapped out. Later I'm actually switching the camera back to this dummy even though I've already possessed the new pawn. This is because of that bug I mentioned earlier.

The other key thing to note is the final "Set View Target with Blend" node. I'm setting the blend time to interpolate between cameras (you can change this to your liking), and checking the box that says "Lock outgoing".

Don't forget to set your default player controller BP if you create a new one. You can try this BP for yourself in the third person template if you like. You'll need to make a custom player controller BP, a 2nd character BP with a different material and/or offset camera component, and some sort input action event.

alt text

controller-bp.jpg (472.5 kB)
more ▼

answered Oct 25 '18 at 05:01 AM

avatar image

PixelOmen
612 21 15 35

avatar image D4njo Oct 26 '18 at 03:07 AM

Would it be possible to help me out with a visual of how this would look like in blueprints? Sorry I'm still not very good at this. In the mean time I'll try it out and see how it goes.

avatar image PixelOmen Oct 26 '18 at 06:29 AM

See my edited answer above. I actually found a bug that makes this slightly more difficult than I expected, but still doable.

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

answered Oct 26 '18 at 12:30 PM

avatar image

redbox
4.2k 80 16 103

(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