How to lock XYZ location of camera?

Hi there,

I’m using a Third Person template, I’ve made it so that when the character dies, he ragdolls to the ground.

I want to make it so that the camera that follows the player stays in it’s XYZ location, but still rotates to look at the player. Since the camera is attached to the ‘camera boon’ which is attached to the player, the camera also ‘falls’ when the character ragdolls. Is there any way to keep the rotation of the camera following the character but the location of the camera locked in place?

This is what it looks like but I’m not sure where to go from here:

Thank you for any tips!

Hey @vizorsnix!

So to start out I’ll ask: Is your boom attached to the MESH or the root?

Because if it’s attached to the root and the mesh goes flying, it should stay still. THEN:

On TICK: Add a branch with a bool input, defaulted false and set it to TRUE on your “1” press. Off of that: You want to use a “LookAt” Node, it should take an input of two vectors. Grab your camera->GetLocation for the first vector, and grab the MESH component ->GetLocation for the second vector. Plug the output there into a “SetRotation” node with the camera actor hooked in and it should follow the player mesh, but the bool helps make it only do so when the actor goes flying. :slight_smile:

If you have any more questions or need clarification on any steps don’t be afraid to let us know! :slight_smile:

1 Like

Hi @Mind-Brain, thank you for your reply!

The camera was attached to the Mesh, attaching it to the root makes the camera stay still when the mesh ragdolls. I can work with this, thanks!

I am having a little bit of difficulty following your next step. I think maybe i got the first part right, but I’m not sure which SetRotation node you mean, there are a lot and none of them seem to give the desired effect.

Screenshot 2023-09-22 212917

Just use Set World Rotation of the Follow Camera on Event tick

1 Like

image

Got it, Thank you guys!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.