Hello everyone I’m currently stuck in a little problem and i dont know what to do
it seems that AttachToComponent(RootComponent); don’t work anymore seens i got to UE 5.0
VS2022 says :
“‘USceneComponent::AttachToComponent’: function does not take 1 arguments”
can anyone help me?
thanks in advance.
High500
(High500)
February 26, 2023, 3:40pm
2
hI @Scholars_Heaven
Not sure if it has changed but there are 3 arguments?
AActor::AttachToComponent | Unreal Engine Documentation
1st 2 are mandatory i believe socket is optional
thanks I’ve tried this too but still not working
High500
(High500)
February 26, 2023, 4:03pm
4
is the error the same? can you post an image of the log filtered by errors?
High500
(High500)
February 26, 2023, 4:30pm
6
so have you found each one of those references (5 if i counted correctly) and added in the 2nd none optional parameter?
Also error C4458 you may possibly have named a variable and a class member with the same name which isnt good in practice. But it may still compile.
Nope theres 6 not 5!
well I don’t know what to do so…
here is the code :
ProceduralPlanet.zip (16.9 KB)
ugmoe
(ugmoe)
February 26, 2023, 4:41pm
9
you need to add transform rule like this
CaptureComp->AttachToComponent(CameraComp, AttachmentTransformRules::KeepRelativeTransform);
1 Like
thanks i will try it right now.
High500
(High500)
February 26, 2023, 4:45pm
11
Scholars_Heaven:
AttachToComponen
well done you beat me to it was just going to paste it!
High500
(High500)
February 26, 2023, 5:08pm
14
i was replying to @ugmoe he beat me to the code he posted
ah, sorry.
but still thanks now it seems to work.
(it has now popped out new errors )
1 Like
High500
(High500)
February 26, 2023, 5:15pm
16
Always does my friend
Good luck, if its a new error post away!