I am currently developing a custom component for grabbing Physics Objects. In there I have a replicated function:
UFUNCTION(NetMulticast, Reliable, WithValidation)
void Multicast_SuccessfulGrab(uint8 InGrabID, UPrimitiveComponent * InComponent, int32 InBoneIndex, FVector GrabLocation, FVector GrabbedActorPosition, FQuat GrabbedActorQuat, FTransform ComponentTransform);
virtual bool Multicast_SuccessfulGrab_Validate(uint8 InGrabID, UPrimitiveComponent * InComponent, int32 InBoneIndex, FVector GrabLocation, FVector GrabbedActorPosition, FQuat GrabbedActorQuat, FTransform ComponentTransform);
virtual void Multicast_SuccessfulGrab_Implementation(uint8 InGrabID, UPrimitiveComponent * InComponent, int32 InBoneIndex, FVector GrabLocation, FVector GrabbedActorPosition, FQuat GrabbedActorQuat, FTransform ComponentTransform);
when I call the function like so:
Multicast_SuccessfulGrab(
InGrabID,
InComponent,
InBoneIndex,
OutClosestPoint.ClosestWorldPosition,
GrabbedActorTransform.GetLocation(),
GrabbedActorTransform.GetRotation(),
GetComponentTransform()
);
The engine crashes
MachineId:D5161B834062B979112122AC3C60BC5F
EpicAccountId:7bd2a856164d4a969a7c6708527b5871
Access violation - code c0000005 (first/second chance not available)
UE4Editor_FPSPhysHandleTest!UNetworkedVRPhysicsHandle::Multicast_SuccessfulGrab() [d:\jonasfiles\projects\unrealtestprojects\vrphysicshandle\fpsphyshandletest\intermediate\build\win64\ue4editor\inc\fpsphyshandletest\fpsphyshandletest.generated.cpp:139]
UE4Editor_FPSPhysHandleTest!UNetworkedVRPhysicsHandle::Server_AttemptGrab_Implementation() [d:\jonasfiles\projects\unrealtestprojects\vrphysicshandle\fpsphyshandletest\source\fpsphyshandletest\networkedvrphysicshandle.cpp:71]
fpsphyshandletest.generated.cpp:139 is the last line of the following code. I guess FindFunctionChecked() does not find a Function, resulting in the crash.
void UNetworkedVRPhysicsHandle::Multicast_SuccessfulGrab(uint8 InGrabID, UPrimitiveComponent* InComponent, int32 InBoneIndex, FVector GrabLocation, FVector GrabbedActorPosition, FQuat GrabbedActorQuat, FTransform ComponentTransform)
{
NetworkedVRPhysicsHandle_eventMulticast_SuccessfulGrab_Parms Parms;
Parms.InGrabID=InGrabID;
Parms.InComponent=InComponent;
Parms.InBoneIndex=InBoneIndex;
Parms.GrabLocation=GrabLocation;
Parms.GrabbedActorPosition=GrabbedActorPosition;
Parms.GrabbedActorQuat=GrabbedActorQuat;
Parms.ComponentTransform=ComponentTransform;
ProcessEvent(FindFunctionChecked(FPSPHYSHANDLETEST_Multicast_SuccessfulGrab),&Parms);
}