Static Camera for fighting game

Sorry for the noob question but basically i added a camera to the level and set it up to be the main view. The camera works while the player is alive, but when the player is killed, the camera turns around. When the player respawns the camera is back.

Here are what the level blueprints look like

I’m pretty sure it is because the player controller is being destroyed, therefore messing up the camera, but I haven’t been able to find a way around this. How can I fix this and make it better?

Hello Jcary13,

I recently created a very simple camera blueprint that I believe you’ll find useful. It does not rely on the character holding the camera.

See my thread here (2nd post): Parallax scrolling with orthographic camera -- method advice please - Blueprint - Unreal Engine Forums

I posted the blueprint images.

----- If this post resolved your answer please mark it as a good answer so that the community can benefit from our efforts. Thank you!

I don’t fully understand what you did with that camera. could you elaborate on your “Demonstration of how to call to the CameraBP we stored in our “WorldCamera” variable.”

Jcary,

the reason your camera is being funny after your character dies is because you’re destroying it when you destroy the actor, as your camera is tied to your character actor.

You need to make a camera outside the character blueprint. In my example I created a character blueprint and a camera blueprint, both are two different actors. I placed my camera blueprint in the viewport, found it within my player blueprint, and then I instruct it where to move using my character blueprint.

The variable WorldCamera is a reference to the camera actor I placed in the viewport. This allows me to call its functions and move it about easily.

That makes sense, thank you! I have things setup up the way you described, except when I set world camera, it has no output to go to the New View Target like how you have set up.

Are you on 4.7 or higher? This feature wasn’t present until that release.

If not you can drag from the “As Camera BP” in the Cast To CamerBP node (or whatever you are using).

I just updated my project, so now everything looks like your blueprint example, but it is still not working. I’ll have to mess around with it more another day. I didnt think that setting a default camera would be so difficult, hopefully its on Epics fix it list :slight_smile:

Odds are you aren’t successful in finding the camera. Make sure in the Get All Actors of Class you have your camera blueprint selected in the drop-down.

It’s a little tedious for someone new to blueprints a simple task once you get the hang of it.

Feel free to post how far you’re getting with screen caps.

I do have the CameraBP selected in the drop-down.
Yes it is tedious now, and I appreciate the help

Make sure the variable is being set. Put a debug break or print string at the end

this is what i have

At first glance I don’t see anything wrong. Make sure it’s making it to the end, and that you’re calling Find World Camera at spawn / revive. Have to sleep and prepare for work. Find out which part isn’t working and we will go from there.

Jcary13,

did you still need help with this?

Yes I do. The correct camera gets used now but it is still connected to the player and does the same as in my original post.

The obvious answer is to not destroy the actor but simply hide and disable it. However, I’m interested as to why it’s not working and what the proper resolution is. I’ll take a look at my setup once I get home in about an hour 15.

It can be fixed by setting the camera again right after you destroy the actor. My guess is when you destroy the actor it unsets the camera so you just have to reset it.

35700-resolution1.jpg

If you end up needing to set the camera a lot I’d just make a function or custom event for it.

yes that worked! Thank you for your help :slight_smile: