(Need Help)Attach Camera to Socket head Without Rotation

Hello Someone call tell me how can i Attach my Camera in a Head Soocket without the rotation plz :frowning:
(i’m new commer in cpp dev)
this my Camera Code →
cam = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera")); cam->AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepWorldTransform, "Head"); cam->SetRelativeLocation(FVector(10, 0, 80));

And the Result is in the Image →

(PS: Sorry if i don’t have an good english is cz i’m French ;-; )

I DONT KNOW CPP

BUT LOOK INTO “USE PAWN CONTROL ROTATION” IN THE CAMERA SETTINGS

IT IS 100% NECESSARY TO AUGMENT THIS VALUE BY DEFAULT IN A STANDARD FPS STYLE VIDEO GAME IN 2023 AND HAS BEEN PREVIOUSLY IN VIDEO GAME DEVELOPMENT HISTORY TO AUGMENT THAT VALUE IN ORDER TO ACHIEVE THE TYPICAL EFFECT

IF YOU WANT TO SEE ME SET A FPS CHARACTER CHECK MY VIDEOS ON MY PF

ITS IN BP BUT THE THEORY IS THERE AND ITS QUICK AND PAINLESS

GLHF

1 Like

That Work but now i can’t turn my camera :sob::sob:

CAN YOU ATTACH THE PLAYER CHARACTER’S BODY TO THE CAMERA COMPONENT, MAKING THE MOVABLE CAMERA THE PARENT COMPONENT FOR THE “MESH” COMPONENT OR THE SKELETAL MESH COMPONENT YOU’RE USING TO ADD THE PLAYER CHARACTER’S SKELETAL MESH AS A COMPONENT IN THE CHARACTER BLUEPRINT YOU ARE USING

AND THEN SELECT USE PAWN CONTROL ROTATION

But the camera will not be attached to the head socket? :confused:

I DONT USE A HEAD SOCKET

I JUST PUT THE CAMERA THERE ON THE HEAD BECAUSE I DONT HAVE THE PLAYER IN FULL IMMERSION

ok I see but the problem is that in my code the mesh is done automatically so I couldn’t attach it to the camera :confused:
anyway, thanks for your help :slight_smile:

YEA, YOU GOTTA POSSESS YOUR CHARACTER

bonsoir Maelu999,

Try adding this after the SetRelativeLocation():

cam->SetRelativeRotation(FRotator(0,0,90)); 

If that’s pointing in the opposite direction, change the Yaw to -90 instead of 90.