So I’ve began learning and trying to understand Unreal Engine 5.1.1 – networking / replication / RPC’s… I start with the first person sample, and then I create a test RPC in TP_WeaponComponent as such:
header:
UFUNCTION(Server, Reliable)
void Fire_Server();
cpp:
void UTP_WeaponComponent::Fire_Server_Implementation()
{
UE_LOG(LogTemp, Warning, TEXT("Fire!"));
}
I then add an action for firing in Characer header file:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
class UInputAction* FireAction;
And I proceed to add IA_Shoot input action to IMC_Default, and then open BP_FirstPersonCharacter and make sure IA_Shoot is set to work there.
I then use ctrl + alt + f11 for live coding to compile all my changes, or I right click my project under the “Games” section in Visual Studio and build – it doesn’t seem to matter what route I go.
Then when I return to Unreal Editor and click play to preview my changes, the BP_PickUp_Rifle blueprint completely breaks. Tells me to please refresh it. Compile fails for that blueprint. In some similar scenarios I can do File > Refresh All nodes, and then I can compile the blueprint – but in this specific case I cannot…
I get various errors like this:
Can't connect pins Target Character and Pick Up Character : Compiletest 2Character Object Reference is not compatible with LIVECODING Compiletest 2Character 0 Object Reference.
Can't connect pins Pick Up Character and Target Character : LIVECODING Compiletest 2Character 0 Object Reference is not compatible with Compiletest 2Character Object Reference.
[0700.10] Compile of BP_PickUp_Rifle failed. 2 Fatal Issue(s) 0 Warning(s) [in 52 ms] (/Game/FirstPerson/Blueprints/BP_PickUp_Rifle.BP_PickUp_Rifle)
It almost feels like something about my setup is broken because I am not really changing any code related to the BP_Pickup_Rifle blueprint. I understand it relies on TP_WeaponComponent, but I am not changing or breaking any code there.
Any help would be appreciated!