I’m trying to lob a magic ball which all players should be able to do. I’ve made my listener server be the one to spawn the actor for the ball which has it’s own set initial speed and velocity and spawns at a socket attached to the player character. However, the paths that the clients take differ from the server path. Here’s a screenshot.
I’ve made them throw the ball in opposite directions so you can see the difference (Yellow indicates the path for clients, which is true for all clients, while red indicates the path for server)
These are the blueprints for my Animgraph which triggers the event in my Character Blueprint for spawning the magic ball which actually runs the predicted projectile path. It would be nice if anyone could tell me where my error is and how I could make the server and clients projectile path the same Thanks in advance
Anim Graph
Character Blueprint
Magic Ball actor blueprint (the projectile does indeed follow the predicted path quite closely so it’s not an issue with the prediction itself)
I’m not sure, but I bet that Predict Projectile Path by Trace Channel node is running in world coordinate space, but the Projectile Velocity is relative to the projectile actor’s forward X.
I noticed it doesn’t take any rotation inputs to see which way the projectile is facing. So that velocity vector input must be world space, not based on the direction the projectile is facing.
try making that projectile forward velocity be part of the character’s forward vector and feed the result of that into the Predict node. On the other hand, that doesn’t explain why it would be correct on the server, so I’m not sure if that helps.
Thanks for the help but shouldn’t having a vector and a location be enough to calculate the projectile’s motion?
And if it was the case, wouldn’t it mean that facing a different direction would result in a different predicted projectile path? In my case, it has the same projectile path no matter which direction i’m facing, the only difference is between the server and the client. (In the screenshots, the directions which the predicted projectile path took were in random directions, not straight along the x or y axis)
Server Version
Client Version