The problem I have right now is that the rotation of the replicated actor(the ballon weapon) is different between server and clients.
All clients see the same rotation (I tried it with 2 clients and the server), however the server see a different rotation (as you can see in the picture)
Here is what I’m trying to do.
I pick up the weapon. (attach the skeletal mesh to the player socket)
I press a key to throw it. (detach the skeletal mesh and add impulse to simulate a throw)
I expect the transformation of the object are same for server and client. It seems I have some problem with the rotation, the location seems replicated fine.
The actor I have has a SkeletalMesh from the infinity blade set.
The way I try to sync the transformation is like this… When I throw the weapon, the tick will track the position of the skeletal mesh and set it to a variable called “server transform”. That variable is “RepNotify”, which tries to sync the transformation to all clients. It’s somewhat working so far…
When I log the transformation detail of the weapon Actor, defaultSceneRoot and Skeletalmesh, they show the same transformation on both server and clients.
Previous to this, I tried attach/detach to actor, but I couldn’t able to get it work as far as right now. Maybe I did something wrong. Also, using “replicate movement” doesn’t seem do anything when I throw the weapon.
Please help me out. Thanks. Let me know if you need more details.
Is your weapon in a Blueprint? If so what is the parent of the Blueprint?
I would use SkeletalMeshActor and when you throw the weapon set it to simulate physics and have the Replicates and Replicates Movements ticked.
I always found it hard to replicate the movement of just Actors I always have to make them StaticMeshActors or SkeletalMeshActors.
Try just this on its own, let us know how you get on.
Edit: Websense at work showed your picture after a restart and I can see you’re using ‘Actor’ as the parent, click File > Reparent and select SkeletalMeshActor
The SkeletalMeshActors suggestion works with replicate movement checkbox. I cleaned up the tick and server transformation repnotify.
However, the difference is still there. You can see that client 1 and 2 are on the same rotation, but server is on a different rotation. I added a couple arrows to make it look obvious. You can see that the server has its rotation off by 90degree from the blue arrow. Client 1 and 2 have the correct rotation.
When I pick up the weapon, the server rotation corrects itself (the mesh overlaps the blue arrow). It’s off by 90 degree again once I detach it.