Movement based on "security camera" rotation

Phew, this is gonna be a fun one to explain…

Let me start out with saying, that I mostly have no friggen clue what I’m doing here, but I think that I am getting a grasp on things (I guess you’ll be the one to decide that XD).

So right now I got two different cameras. There’s a default one that follows my character around at a set angle (Diablo-esque), and then there’s the other camera… A security camera (Resident Evil style, I guess)

Here’s a video of the camera that I’m trying to fix up:


I found a tutorial how to create a security camera that follows my character around (as a blueprint), and am now trying to figure out how I can make the characters movement change to fit with the angle of the camera.
So far I’ve done this:
I have created a blueprint interface with a function called “Camera Stuff” (great name), and added two vector outputs. I then added this interface to my security camera blueprint called “Camera_Tower”. Inside of this blueprint, I added two variables called “Forward Rot” and “Right Rot”, as shown in the image below.

56604-camera+stuff.png

At the end of my camera blueprint, I get a rotation value, that I then use to set my two variables in the interface with, as shown below.

Now back to the player controller, I’ve got this setup, because I want the camera and player movement to change based on a bool, but I must be doing something wrong. I am not exactly sure where the issue lies, so I’ve shown you all my steps. Hope you can help :slight_smile:

Losing my hair because of this…

Hello, I’m a bit confused as to how you want your security camera to move. Are you trying to have the security camera follow the character’s position from a stationary location in the level? Or is it moving with input from the player controller? Or am I totally off the mark?

Oh, I’m sorry I actually had a video of it but forgot to link it, here you go :slight_smile: - YouTube
So the camera I’m talking about is in the middle, following the character all the time, and I’m thinking of adding several cameras for each floor you’re in so it will be switching between several stationary cameras. And as you can see in the video, the controls are not so fun …

Try this out.

The “Red Box” is the direction that you want the character to move. This is turned into one vector by adding them in the “Blue Box”. You could also place the axis values directly into the Make Vector node to avoid the add node, but I’m trying to make this one as similar to your blueprint as possible.

You will need a reference to the camera in the scene that is following the character.“Yellow Box” In my project, I have 4 cameras throughout the level which are stored in an array. I use the Get Node to retrieve it, however if you only have one camera in your level, you do not need to use a get Node, you can use the reference to the camera by itself.

To accommodate the change in the camera as the character moves, you will need to get the cameras rotation any time you want to move the character(“Green Box”).

The rotator that you get from the camera (which is currently being used to watch the character) is used to rotate the direction input that you will pass into world Direction. "Orange Box"

I am not sure what you meant with the Direction Input. Should I also use a gamepad axis?

I tried using the GET node and as inputs I promoted them to variables, but they can’t be changed so I don’t know how to add my blueprint camera to the array.

I updated the solution to be closer to your original blueprint. You do not need to use the GET node unless you are using an array of cameras.

I think the issue at hand is that I cannot reference the blueprint camera, or I just don’t know how to reference it properly. The blueprint camera is in my level.

In your Character Controller Blueprint, create a Camera Actor reference variable.

Then, in the Level Blueprint Event Graph, if the camera is not already a variable, select the camera in the level and then go back to the Level Blueprint Event Graph, Right Click and select Create a reference.

Next you will use an Event Begin Play Node. Connect it to a Cast to .

From the "As " node on the Cast to Node, pull off a Set .

That will set up the reference for the camera in your level within the character controller.

I feel stupid. Sorry… I tried going down this road before, but I keep failing when it comes to figuring out what the “object” is supposed to be…

Use Get player controller[0]. The cast is used to get access to any additional variables or functions that you added to make your player controller class, otherwise the engine will see it as the base class if my understanding is correct.

I got it to work! Thank you for your patience :slight_smile: I changed it a little to fit with my needs but know that I am really grateful!

No problem, I learned some new stuff along the way so it was worth it. Good luck with you your project!