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"

Child actor not replicating correctly with AttachToComponent

So here is a weird issue: I got a child actor that Attaches to Component in the construction script. Everything attaches correctly on the server/splitscreen, but connecting clients see the child attached quite a bit further away. The child still follows the parent's location, it just seems the initial attach point is 'up in the air' for clients.

These two screenshots are in-game at the same time:

alt text

alt text

Here is the construction script and hierarchy:

alt text

alt text

Also notable, the floating UI is in 3D space and next to the gun but isn't impacted by the weird offset. The other attach, which mounts the camera to a socket is working correctly. I have attempted:

  • Changing the location rule in the 'AttachToComponent'

  • Running the 'AttachToComponent' manually after client load in

  • Running the 'AttachToComponent' via the server manually after client load in

No matter what I do, the clients will always see the child actor attached differently than the server, but they still replicate correctly otherwise.

For some slight context: I'm using a child actor for the guns as I have a Borderlands-esque randomized gun system.

Is there something obvious that I'm missing?

Product Version: UE 4.18
Tags:
serverview.jpg (98.7 kB)
clientview.jpg (92.3 kB)
blueprint.jpg (58.4 kB)
heirarchy.jpg (19.7 kB)
more ▼

asked Mar 22 '18 at 10:14 PM in Blueprint Scripting

avatar image

justdaveisfine
26 1 2 5

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

2 answers: sort voted first

Alright this one was a bit weird and I'm somewhat convinced it might be a bug:

The child actor component had a static mesh, that, when replication was on, would throw the whole child actor into seemingly random locations. (But only for the client)

If replication was off, the child actor would be in the right location but the mesh wouldn't get the message to spawn in the static mesh, so it was invisible.

To 'solve' this, I put the static mesh in another blueprint with replication turned on, and then used it as a child actor within the child actor.

 So it's like this:
 (This won't work correctly)
 - Player
    - Child Actor
       - Static Mesh (When static mesh has replication on)

 But:
 (This works correctly)
 - Player
    - Child Actor
       - Child Actor (Replication on within class, but not on as a child actor)
          - Static Mesh 

I'm sorry this is weird and if its explained poorly, but I hope this helps someone if they run into this issue.

more ▼

answered Apr 07 '18 at 11:44 PM

avatar image

justdaveisfine
26 1 2 5

avatar image RJM Sep 30 '18 at 04:18 AM

I just had to deal with this. wasted a lot of time. thank you. glad i found this. this has to be a bug. please fix Epic.

edit using 4.20.3

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

WOW. This fixed my issue. It makes no sense but I'm glad you took the time to post and explain it clearly with the hierarchy.

more ▼

answered Feb 04 '19 at 03:45 PM

avatar image

NickNasti
6 1 2 3

(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