Ideas for setting up a "true" First-Person-Camera?

Hello,

I am relatively new to UE4 and my current goal is to create a “player-character” C+±class that inherits from ACharacter.
I would like the camera to be attached to the characters skeletal mesh respectively a fitting socket (e.g. an eye socket). Unfortunately all the attachment-setup functions that I could find inside USceneComponent.h required “USceneComponent”-pointers as arguments.
Any clues what I’m overlooking?

Thanks in advance

Why not just attach it to the Mesh of the character and then set it to the socket name? No idea whether this would actually work but I don’t see why not as RootComponent is actually allowed so Mesh should be as well as long as you define the mesh within C++.

Another way you could do it is just set it to a camera boom in the position of the characters eyes and simulate blinking etc.

Just wanted to point out that if you even get it into the players eye socket you will have the issue of the players mesh glitching into the camera all the time meaning you will have to create custom animations that make sure that the players head does not come too far forward.

If I am thinking of what you want to do it would be like ARMA style, in the fact that both the third and first person animations are 1:1. The way I would do it is simply create a mesh for 1st person that has his head removed and can only be seen by the owner and for the other players use the actual players mesh that has a head that is invisible to the owner. Setup the same animations maybe use a Rig for the 1st person to get a 1:1 animation setup. Use the same animation blueprint just tweaked slightly for the 1st person mesh. Also disable the dynamic shadows on the 1st person mesh so that only the third person ones are shown. After this you can simulate blinking or whatever you would like just by using camera effects.

Thanks for the quick answer. It seems there are some things I should explain.

Why not just attach it to the Mesh of the character and then set it to the socket name? No idea whether this would actually work but I don’t see why not as RootComponent is actually allowed so Mesh should be as well as long as you define the mesh within C++.

RootComponent is allowed, because it inherits from USceneComponent. USkeletalMeshComponent does not. So allthough my mesh has been defined (as I stated, my class inherits from ACharacter), it is not possible to use it with the “USceneComponent::SetupAttachment”-function, as this function requires USceneComponent-pointers as arguments.
This was my initial question. Are there any alternative functions I can use?

Another way you could do it is just set it to a camera boom in the position of the characters eyes and simulate blinking etc.

At this very early state I haven’t even thought about details like blinking. The reason why I want the cameras location and rotation to be bound to the characters head is, because I want the perspective to feel “organic” during all kinds of crazy movement. If I don’t bind my camera to my mesh I would have to setup a separate “camera-animation” to simulate the head movement for each and every single character-animation. That would not just mean a ton of work but also be rather impossible, once I start using physical animations (which I’d like to).

If I am thinking of what you want to do it would be like ARMA style, in the fact that both the third and first person animations are 1:1.

I would rather not use a “third-person-mesh” and a “first-person-mesh” that just simulates the movement of the characters limbs. This system works (somewhat) in ARMA because all the chatacter needs to do there is moving around and shooting guns. As soon as you want to create an application, where your character can interact with or be affectet by the environment in a physical way (what I’d like my character to) this method does’nt seem to be the most practical or logical approach.

I hope this mess is somewhat comprehensible :smiley:
(Did not fit into one comment)