How to get previous item from OnRep_CurrentItem?

So I have this function that handles the replication of CurrentItem variables, and CurrentItem is set to replicate using this. But how do I pass on the previous item?

/** Handles replication of CurrentItem
 * @param PreviousItem				Previously equipped item
 */
UFUNCTION()
	virtual void OnRep_CurrentItem(ADHUsableItem* PreviousItem);

I know this is late but if anyone faced this in the future, you can pass to the OnRep function a parameter of the same type of the value being replicated under this function, and it will automatically pass the old value of this variable

1 Like