Is there any way to use "Rotation Follows Velocity" in Multiplayer Game?
Here is my task. An archer-player holds the Fire button for some time to increase the shot power. Archer and bow play for some shot animations. On button release the arrow flies with initial speed based on power calculated. All the clients should see the arrow flight and the shooter animations. Dedicated server.
I'd like to use the property of Projectile Component for natural flight.
The flight trajectory is perfect, but all clients, even the arrow's owner, see the arrow, with the sharp point down. It flies all the way "looking" on the ground, like it is shown on my picture. Besides the fact that I'm not an artist, it's obviosly seen that on client side "Archer's" variable InitBulletSpeed is 0. Debug shows that the problem is that all the clients, even the arrow's owner "do not know" who is the owner. So, when the arrow's Const Script runs on a client, function GetOwner returns None.
It should be said that of cause both the archer class and the arrow class have properties "Replicates" and "Replicate Movement" checked. Projectile movement component of arrow also replicates. Relevancy props are in default states. So, I can't understand why the owner is not known by clients, I can't transmit any data to Const Script(for example, the archer-shooter, or speed var from him), and I can't set the arrow's init speed anywhere except the Const Script.
I would be thankful for any ideas!
P.S. I'm not sure, but may be it's important - archer class is not the default player's pawn, it is created during the game.
asked Mar 02 '17 at 01:17 AM in Blueprint Scripting
You state that the flight path is fine but it just faces the wrong way... I assume that your arrow has a Blueprint? Go into the Arrows Blueprint and in Viewport try rotating the arrow in the Transform setup
answered Dec 20 '17 at 08:09 AM
Theres a checkmark for "Rotation follows Velocity" in the projectile movement component, did you try that out?
answered Aug 12 '17 at 04:24 PM
Velocity is not replicated from sv to client, so i think u cant use Replicated Actor to perform this Rotate follow velocity. Instead of that, u can use the Combine func Run on Server + Multicast to spawn the Arrow on All Server and clients, and make sure the arrow does not replicated. And when the Arrow collide with something, u can check if that arrow is on server -> do your logic here. That is my solution for this.
answered Dec 20 '17 at 07:20 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here