Download

error C2228: left of '.Size' must have class/struct/union

I’ve tried every alteration of the Syntax I can think of, what am i doing that’s wrong in this line of code?



const FVector VEnd = FVector(GetActorLocation() + (0.5f + (Mesh->Bounds.SphereRadius) / (Mesh->GetComponentVelocity.Size)) * (Mesh->GetComponentVelocity.Size));


I keep getting the following error:

1>E:\Users\James\Documents\Unreal Projects\Hovercraft\Source\Hovercraft\HC_Pawn.cpp(44): error C2228: left of ‘.Size’ must have class/struct/union
1>E:\Users\James\Documents\Unreal Projects\Hovercraft\Source\Hovercraft\HC_Pawn.cpp(54): error C2228: left of ‘.Size’ must have class/struct/union

Try .Size()

No luck, same error as before :frowning:

Looks like you probably want Mesh->GetComponentVelocity().Size() instead of Mesh->GetComponentVelocity.Size - both are functions.

Thanks, that’s what I thought and I was sure I’d already tried that. Fixed now :slight_smile: