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"

Attaching object to component with Replication

To best ask the question I am going to describe what I want to do. If a player picks up an item from the ground, goes to his/her inventory system and equip it to the first slot, I want that mesh to attach to the player's hand. I have got it working all the way for the server and it works fine. If I am playing as the server as soon as I attach the item I can see it attach to the players hand on the client side. However, when I play as a client it doesn't work.

The way I am doing it(and there is probably an easier way) is that in the pawn that I am controlling has a function that runs on server and has parameter of the pawn that is requesting and the object. I did some debugging and I found out that once the object get to the server function it is lost unless I am playing as the server.

Any advice would be greatly praised.

Product Version: Not Selected
Tags:
more ▼

asked Jan 14 '15 at 04:45 AM in Blueprint Scripting

avatar image

El Death Taco
43 7 9 13

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

What I did to fix it was made a spawn actor and pass it the class of the object I wanted to spawn. Then I attached new newly spawn object to the character.

more ▼

answered Jan 18 '15 at 07:47 AM

avatar image

El Death Taco
43 7 9 13

(comments are locked)
10|2000 characters needed characters left

Do you call attach on client side also ? Cause item if it not replicated client will never know, and also depend on what component replicated on item, so something like attach parent is never replicated. For you case you can call attach on your local, then tell server to attach, then server need to tell all other client to attach item also.

more ▼

answered Jan 14 '15 at 09:35 AM

avatar image

Duncan Dam
3.1k 121 50 164

avatar image El Death Taco Jan 14 '15 at 07:58 PM

Thanks for the response. Right now I created a custom function in blueprints that 'runs on server.' The problem is that if the client call that function it loses the the object that should be attached to the the player's hand.

(comments are locked)
10|2000 characters needed characters left
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