x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Cannot Define RPC Function With Param APawn*

my class is just so simple:

 UCLASS()
 
 class MYPROJECT_API AMyPlayerController : public APlayerController
 {
      GENERATED_BODY()
     
     UFUNCTION(Server, Unreliable, WithValidation, NetMulticast)
     void MulticastCameraData(APawn* Pawn);
     void MulticastCameraData_Implementation(APawn* Pawn);
     bool MulticastCameraData_Validate(APawn* Pawn);
 };

but, it comes out the error when i try to compile: Function parameter: 'Pawn' cannot be defined in 'MulticastCameraData' as it is already defined in scope 'Controller' (shadowing is not allowed)

I cann't understand! Please Help!!

Product Version: UE 4.14
Tags:
more ▼

asked Jan 09 '17 at 08:08 AM in C++ Programming

avatar image

RainStoneUNREAL
15 3 4 6

avatar image ImVawx ♦♦ STAFF Jan 09 '17 at 04:51 PM

"Pawn" is already defined in APlayerController.

Try renaming your argument "Pawn" to something like "InPawn" and see if that fixes the compiling issue.

avatar image Xternalhardrive Jan 11 '17 at 03:26 AM

^^^, Pawn is already a variable. Also you should delete "Server" in your UFUNCTION definition because you only want "NetMulticast" because the compiler might get confused about whether it's a multicast or a server rpc. Read https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Actors/RPCs/ for more detail on RPCs

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

thank you guys! that's really helpful!

more ▼

answered Jan 18 '17 at 06:07 AM

avatar image

RainStoneUNREAL
15 3 4 6

avatar image RainStoneUNREAL Jan 18 '17 at 06:08 AM

i post the answer just for remark the question as RESOLVED!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question