I have a replicated function that needs to take a variable that was constructed on the client side. In theory I could replicate the variable and try to do things that way but in this case I don’t feel that is the way to go. I basically have something like this
MyClass.h
UFUNCTION(reliable, server, WithValidation)
void MyFunction(AMyObject* myObject);
void SomeOtherFunction();
MyClass.cpp
void AMyClass::SomeOtherFunction()
{
// Do some stuff and make a MyObject
MyFunction(myObject);
}
void AMyClass::MyFunction_Validate(AMyObject* myObject)
{
return true;
}
void AMyClass::MyFunction_Implementation(AMyObject* myObject)
{
// Do some stuff with myObject
}
Now, the problem is that once inside the MyFunction
function the myObject
parameter is null
. I have made sure that myObject
is indeed not null when passed into MyFunction
.
I’m not a C++ pro, I’m a C# developer by day, but I think the issue might be because i’m passing the variable pointer and that location in memory is null
? I’m honestly not sure though, does anyone have any insight on how I can get this to work?