Camera Parented to an object

Hello people,

My question is how to parent the camera to a cube with an animation, so that when the play button is pressed the camera is following the cube. I’ve read somewhere that I need to change the game mode so that the actual camera is being used. How do I do this?

Thank you for helping.

Greetings,

Hey Paratrongatulus,

You can change your Default Game Mode by going into the Project Settings and then going to Maps & Modes. Underneath Default Modes, you’ll see Selected GameMode which you can switch to the correct one for your project. Here is some [additional information][1] for you regarding switching the GameMode.

Thanks! :slight_smile:

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/SettingUpAGameMode/Blueprints/index.html

Thank you for your answer, but this still doesn’t resolve my problem.

I have a cube with an animation, I want a camera to be parented to that cube. When the play button is pressed it should show the camera. The information you gave me is only how to create a new game mode, which is partially a problem.

Could you please help me to bind the camera to the cube? Just attaching it doesn’t work?

Did you try set view target from player controller ?

Hi, thank you for your reply!

I think I understand what to do, but where can I find it?

easy way is go to the LevelBlueprint, call BeginPlay event then from that GetPlayerController, and from player controller you can call SetViewTarget with target object is the moving object.

I have the nodes but none are compatible, what did do wrong?

Thank you for helping me, I’m relative new to ue4. I know what you mean but in the Levelblueprint I can’t attach nodes.

Something like this

Aha! I thought Set View Target with Blend was the wrong node! I’m on it!

When I press play my view snaps to the center of the object, and the view doesn’t actually move. But when I assign the camera instead of the moving object I see the camera view when I press play.

But how does this parent my camera to the cube, here’s a screenshot

Hey ,

When you’ve added the camera into the blueprint with the cube animation, you should be able to change the category in which the camera is attached to. This means that you would be able to select where that camera is attached, including any socket from the skeletalmesh.

Here is another [AnswerHub post][1] which is similar to what you’re asking, hopefully it ties together what you’ve learned from the community over the past day. :slight_smile:

Let us know if you have any further questions, have a great day!

Can I parent a camera to an animated skeletal mesh? - Cinematics & Media - Epic Developer Community Forums

That was easy! Wow! Thank you so much! Still have some issues, but I’ll have to figure them out myself.

.

Hey ,

You’re welcome. If you have any further questions, feel free to post a new question to AnswerHub!

Cheers!