I am making a fireball launcher (I've had a question concerning this launcher before), and the accuracy is off. This is because it is firing based on the camera, including its position.
So I'm trying to make it where the fireball starts at the position of the player's Head, and fires 100 studs in the direction the camera is looking. Here's the current formula I'm using:
cameraCframe:ToWorldSpace(CFrame.new(0, 0, -100))
This did work, somewhat. If the camera was close to the player, it seemed to reach the destination just fine. But, when I fully zoom out and use the move, it moves 100 studs in front of where my camera is, which is around 10-20 studs away from my character. Obviously, this did not work.
I tried a new formula:
CFrame.new(client.Character.Head.Position, cameraCframe.LookVector):ToWorldSpace(CFrame.new(0, 0, -travelDist))
I don't even know what happened with this one. The best that I can say about this one is that it was firing in weird directions.
I think that somehow fusing the player's Head CFrame (for the position) and the camera's CFrame (for the direction) would work. If this is the way to do it, how would I do that? My last attempt at this obviously failed.
Thanks for reading!
