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. 

Player(Client) Can't Destroy Other Actors.

Hello Guys I am new here. Am trying to make a Player(Client Not Server) To destroy an Actor when Pressing the button "E" But it doesn't work. I Searched about my problem but i couldn't find anything. Can you please Help me !! :)

P.T Am using the default multiplayer system.

MainPlayer(Blueprint)

Product Version: UE 4.21
Tags:
2019-03-02.png (263.7 kB)
more ▼

asked Mar 02 '19 at 07:12 PM in Blueprint Scripting

avatar image

THT_Nick
19 1 2 3

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

1 answer: sort voted first

Destroy should only be called on the server so your ServerDestroy event should be a RunOnServer Event and not a Multicast RPC.

more ▼

answered Mar 03 '19 at 01:50 AM

avatar image

GarnerP57
816 3 4 8

avatar image THT_Nick Mar 03 '19 at 11:22 AM

I Tried this as well.... not working

Pic 1

2019-03-03.png (263.5 kB)
avatar image GarnerP57 Mar 03 '19 at 11:48 AM

Are there any warnings or errors in the log?

avatar image THT_Nick Mar 03 '19 at 12:00 PM

Yes here are they

if you can't read it in the image here it is

(Blueprint Runtime Error: "Accessed None trying to read property CallFunc_BreakHitResult_HitActor". Blueprint: MainPlayer Function: Execute Ubergraph Main Player Graph: EventGraph Node: DestroyActor )

Errors

2019-03-03-1.png (125.8 kB)
avatar image GarnerP57 Mar 03 '19 at 12:05 PM

So how do you get the "target" for the Destroy node?

avatar image THT_Nick Mar 03 '19 at 12:20 PM

With A Line Trace

From The Hit Result --> Hit Actor Then goes to the Destroy Actor

alt text

2019-03-03-2.png (261.7 kB)
avatar image GarnerP57 Mar 03 '19 at 12:39 PM

I see. What appears to be happening is that the Client is asking the Host to do a line trace from the Host point of view. What you actually want to happen is more likely the Client asking the Host to do a line trace from the asking Client point of view. Get rid of the Tick node and instead do the trace when the Client Press E and add the hit actor as a parameter in the ServerDestroy node and then the server simply destroy that specific actor.

avatar image GarnerP57 Mar 03 '19 at 12:41 PM

BTW if the hit actor is null you should not try to call ServerDestroy as it is pointless.

avatar image THT_Nick Mar 03 '19 at 12:49 PM

Ohhh That worked !! Thank you so much. :)

avatar image GarnerP57 Mar 03 '19 at 12:51 PM

You're welcome :)

(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