I can’t figure out how to get the attach actor to actor to multi-cast, everything else seems to work fine, except for that one part, and all works on the server, but the attach actor to actor isn’t replicated on the client(s)
i made a video here if anyone cares to take a look,
I suspect there are a couple of issues going on here. I’m not in front of UE at the moment to throw something together to test so in lieu of that I’ll throw some ideas/thoughts out there in case they’re helpful. When I’m back in front of UE, if this hasn’t already been resolved, I’ll test some theories…
If I remember correctly, AttachActorToActor will replicate (for replicated actors). Which means it only needs to be called on the server versions of the pawn and car. Replication will make sure that relationship gets pushed to the clients.
I can’t tell from what was shown but you will need to make sure that all movement of the vehicle occurs on the server and is replicated to the clients. That jittering of the pawn looks like position corrections being done from server to client. Meaning the client isn’t where the server thinks it should be so the client is correcting it so it matches what the server thinks is happening.
It might be simple enough to just rout the pins from SVRGetInCar to the nodes following MCASTGetInCar as it might just work out of the box. Like I said, there could be other complex issues going on which I can’t see from the video or screenshot (like the car movement isn’t being properly replicated)
Another thing I’ll throw out there is that sometimes it really helps me if I attempt to replicate the scenario in an empty project. It removes the fear of screwing something up in the main project and also helps remove unrelated distractions by stripping the problem down to the bones. In a sense, if you can’t make this interaction happen between two cubes, you’re not going to get it working with a more complex setup. It’s a great habit to get into and has helped me out of some holes in the past.
If a character is in a car, rather than being run around as a character, you’ll need to also turn off the character movement component, else it will fight the car for where the character should be.
Ok, so I’ve mocked something up quickly for validation. Link to video here…
In the first part of the video I possess the car pawn with the server and on the second part with the client. Let me know if I’m off base with the results.
As per the usual, there are a couple of ways to skin a cat. This was a crude mockup and I would likely not implement this exactly like I have it but it gets the point across. One thing I learned during the process was that if you’re using the character movement component you have to turn off gravity which you turn off collision otherwise you’ll fall through the floor :-).
Let me know if there’s any part of this you don’t understand…or if I’ve totally missed the mark
EDIT: Both the player and the the car are subclasses of the character class so they make use of the character movement component.
you sir, gh0stfase1 are an absolute champion, thank you!! that was probably the most helpful help i’ve ever gotten, thank you so much,
so in my case, you’re example (which i tested) didn’t work, buuuttt, it made me realize at-least, that it should be working, and i so tested on more thing, which had to do with a movement plugin that i was running, and after i removed that plugin, the attach event worked perfectly.
and looking at your blueprint here also shows exactly another question that i was wondering about which is repnotify and how to use it, so thank you double, a lot of muddy confusion is now clear!
If you attach a character to anything and disable the collision, make sure you disable the movement for the character tho. Tip: put the possess node last