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"

How do I destroy a component on the client?

So i'm trying to make an equipment system:

When I pick up an item, I want to attach it to my character and make sure that everyone can see it. (server & clients) This is working. but there is one problem: The collision box which i'm using to pick it up, still exists. When I've equipped a helmet, anyone else can steal my helmet because this collision box is still there. So I've tried to destroy that collision box (destroy component) but it doesn't work no matter what I do.

the client is able to destroy a component in an actor, but the server and other clients can't see it. It only happens locally. I've tried destroying the component on the server but that doesn't seem to work either. I've also tried to destroy it and multicast it but with no effect. Sometimes the client doesn't want to execute any of my functions. I feel like i'm missing 1 simple and important thing. I've been struggling with this for 4 days now and I really can't find a solution anywhere on the entire internet. I've basically tried every possible way and now i'm tired and stuck.

Any help will be grately appreciated! If this gets fixed my entire project will fix itself.

First picture: My helmet blueprint

Second picture: Here you can see how I equip my helmet on the server.

Third picture: Here you can see what I want to destroy on client and server.

alt text

alt text

alt text

Product Version: UE 4.21
2.png (71.8 kB)
1.png (52.3 kB)
3.png (11.4 kB)
more ▼

asked Apr 09 '19 at 09:18 PM in Blueprint Scripting

avatar image

3 1 1

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

2 answers: sort voted first

Did you replicate the item correctly? Did you try to Destroy the helmet completely? just to test if your destruction does actually replicate. Personally I would just disable the collider, because you might want to throw the helmet down and someone might want to pick it up later..just an idea. "SetCollisionEnabled" is your friend here I think :D

more ▼

answered Apr 10 '19 at 08:41 PM

avatar image

6 1 2

avatar image Doomknight1401 Apr 11 '19 at 09:49 AM

I've tried to completely destroy the helmet, and yes, this works for some reason. And you're right about disabling the collider, I was thinking about setting the line trace channel i've created to ignore, I've tried that but with no effect, same issue I suppose.

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

In your first image the client is interacting with the collision box and then destroying it. This will only happen on that client.

Then, image 2, the server puts the helmet on your client.

But nobody has told the other clients to destroy the collision box?

After the server puts the helmet on the client it needs to multicast to an event that destroys the collision box on all the clients. (you maybe should not even destroy the collision box at all on the first client that hits the collision box before calling the server).

What do you think? maybe?

more ▼

answered Apr 10 '19 at 09:21 PM

avatar image

251 4 7 13

avatar image Doomknight1401 Apr 11 '19 at 09:51 AM

Hmm, i'll try that this afternoon! I'll let you know :)

avatar image Doomknight1401 May 18 '19 at 05:57 PM

Ok I found out my repcliation is correct, after some research it seems like I can't destroy the component from my actor. I have to destroy this component on the server so it's destroyed for clients and the server, but how do I reference a component from an actor in another blueprint so I can destroy it there? I've tried lots and lots of ways and solutions but it doesn't work. let me know if you need any screenshots or visualizations.

ps: Sorry for the late reply, I got really busy at work while figuring this one out.

(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