Hi all,
There seem to be a number of questions on this topic, but none of them have answers so I am asking again for my specific scenario.
I am using Blueprints for everything so far.
I have a custom Character, a custom GameState (and GameMode), and a custom Projectile.
The Character fires the projectile, its location and rotation vector are calculated in a client-side function, which then calls a server-side function to perform the authoritative spawn of the Projectile.
In order to play test the proejctile, I have added a menu (Widget Blueprint) where any player can update a “Projectile Speed” variable so we can test out different projectile speeds to see what works best. This variable is stored in my GameState and is replicated.
I have tried numerous methods for using this variable to set the initial and Max Speed of the projectile being spawned, and the only way I can get it to work is if I disable Auto Activate on the projectile’s movement component, and the call Activate in Event BeginPlay. However if I do this, the projectile visuals are no longer smooth, the only way the projectile will move smoothly on server and all clients is if Auto Activate remains enabled.
So with Auto Activate enabled I have tried:
- Setting Initial and Max Speed in Event BeginPlay of the projectile - this does nothing
- Setting Initial and Max Speed in the Construction graph - this makes a difference but based on the visuals the server seems to be respecting the new Initial and Max Speed values but the clients are not
- Using a cached copy of the Projectile Speed variable from the GameState but storing it in the Character
- Using Rep Notify events for the above different set ups.
Nothing works, except for disabling Auto Activate which as I said, seems to cause the projectile to not fire smoothly.
Does anyone have any suggestions or insight here? If I need to move to C++ to make this work I will, but don’t want to go down the path of implementing that if it is going to give the same results.
I really appreciate any advice/help anyone can provide!
Cheers!