Got a little problem here with shooting arrows in a dedicated server environment.
Everything works fine so far, except the only thing that “UProjectileMovementComponent::bRotationFollowsVelocity” doesn’t seem to be replicated or something like this and I can’t figure out what I’m doing wrong.
I tested it in Single Player just see if it is a replication issue. And it seems to be? In Single Player the arrow’s rotation follows its velocity, as it should. However in Multi Player the arrow follows the ballistic arc, but points straight down the moment it gets spawned and doesn’t change anymore.
Hmmm … thats strange. Just tested if it changes anything if I set the “MovementComponent->InitialSpeed” and “MovementComponent->MaxSpeed” to a fixed value and removed adding velocity after spawning. And it does indeed?!
I don’t have “ShooterGame”. Do you mean this? http://shootertutorial.com/ If yes, then I can’t find any source code to download. However, there is a tutorials site where he talks about creating “Grenade Launcher”. But he is also using fixed InitialSpeed and MaxSpeed … Create Grenade Launcher | Shooter Tutorial
Anyone? This behaviour is also reproducable in a blank new Blueprint project.
The problem is:
Setting projectile velocity in combination with “Rotation Follows Velocity” after spawning only works for single player / server, but does not get replicated to the client(s).
Instead clients see the projectile following the correct ballistic arc, but always nose down.
“ThirdPersonCharacter” Blueprint and “Arrow” Blueprint are both set to Replicate and Replicate Movement.
“Arrow ProjectileMovement” Component is set to “Rotation Follows Velocity”
Ok, I had a look. Put in a StaticMesh for the “ProjRocket” projectile to show an arrow and there it works indeed, even in Multiplayer and with Initial / Max Speed = 0. Need to take a closer look then. Thats a great learning source.