I’ve been following along with the UE4 C++ First Person Shooter tutorial but using my own assets. Got to the point where you add your character mesh in and the camera spawns inside the mesh but doesn’t on theirs so they don’t tell you how to fix it. We have implemented camera code so I’m guessing it auto spawns in unreal? I’m moving from Unreal to Unity so i’m a bit confused.
For a first-person shooter it is normal that the first person camera is located inside the third person mesh.
The third person mesh is only meant to be seen by other players, it should be invisible to yourself.
If you are seeing your own mesh from the inside, check the MeshComponent’s rendering properties. There is a checkbox called “Owner No See”. Enabling this should fix the issue.
Or you can do it in C++ from constructor :
Mesh->bOwnerNoSee = true;
If your issue is something different please be more specific.
Ah ok so you don’t place the camera in-front of the mesh? And will it have any other issues being in the mesh like it is? For example when walking into an object?
In section 2.7 of the tutorial it looks like they position the camera slightly above the head of the mesh :
// Position the camera slightly above the eyes.
FPSCameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, 50.0f + BaseEyeHeight));
BaseEyeHeight is a configurable float you should use to define eye offset above capsule center. I am not sure why they add 50 on top of that.
You can change the relative location of the camera however you want. If you want to put it just in front of the eyes, something like this should do the trick :