Ok so pretty much I have a move in my game where u can lift into the air and slam into the ground. You get teleported into the ground on the client then AFTER you get teleported it fires a remote event to the server which handles damage and fires the client events for the effects
However the effects appear in the location prior to the teleport for some reason.
Why is this and how can I fix it?
local direction = char.HumanoidRootPart.CFrame.upVector*-300
local rc = raycast(char,char.HumanoidRootPart.Position,direction)
if rc == nil then
char.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame + direction
else
char.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame - char.HumanoidRootPart.Position + rc
end
this is the teleport part. It works fine and it teleports correctly.
After this I fire a remote event which handles damage then fires client events like so
also I have also put the teleport on the server and for some reason it still came with the same problem.
I tried doing wait(.05) and wait(.1) and it did nothing. But doing wait(.5) before the effects actually makes them pop up at the right location but I dont wanna delay my attack obviously.