Starik_AC
(Starik_AC)
August 6, 2023, 8:38am
1
Hello, need help. I need to write this code in C++.
I watched the tutorial videos and wrote the code.
void APersonazh::OnConstraction(const FTransform& Transform)
{
Super::OnConstruction(Transform);
ShtanyPersonazha->SetMasterPoseComponent(TeloPersonazha);
RubashkaPersonazha->SetMasterPoseComponent(TeloPersonazha);
KapushonPersonazha->SetMasterPoseComponent(TeloPersonazha);
PerchatkiPersonazha->SetMasterPoseComponent(TeloPersonazha);
}
This code does not work for me and clothes are not worn on the character.
I don’t know what to do now, my game is in danger. Help solve this problem.
IrSoil
(IrSoil)
August 6, 2023, 11:14am
2
void APersonazh::OnConstraction(const FTransform& Transform)
{ //^^^
Super::OnConstruction(Transform);
If that’s the real copy-pasted code, then the first thing is to fix this typo in this function name, since this function won’t be called at all.
You could also find out this with a breakpoint, as it will never been hit in such case.
On the side note: those things are usually called: Body, Gloves, Pants, Head, etc. This way code would be more readable if you’d like to share it with anyone.
1 Like
Starik_AC
(Starik_AC)
August 6, 2023, 11:37am
3
Thanks, I got it. The code is correct. Just tell me why I need the line:
Super::OnConstruction(Transform);
Everything works without it.
void APersonazh::OnConstraction(const FTransform& Transform)
{
//Super::OnConstruction(Transform);
ShtanyPersonazha->SetMasterPoseComponent(TeloPersonazha);
RubashkaPersonazha->SetMasterPoseComponent(TeloPersonazha);
KapushonPersonazha->SetMasterPoseComponent(TeloPersonazha);
PerchatkiPersonazha->SetMasterPoseComponent(TeloPersonazha);
}
system
(system)
Closed
September 5, 2023, 11:37am
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.