Currently, I’m working on a magic based PvP game, which involves a lot of size changing, moving parts. With FE being enabled, I can’t just create parts via local script like you used to do, so i have a setup like this;
— serverscript — function magicevent(player) parts created, properties assigned, velocities added, etc end RemoteEvent.OnServerEvent:Connect(magicevent) — localscript — button.Pressed:Connect(function() RemoteEvent:FireServer() end
Sorry for the very vague code, I’m on mobile and tried to give an outline of what I’ve done. I basically have all the creation of parts on the server and have the server handle it once the client calls for it.
This causes a lot of lag, and I was wondering how to do this and avoid the lag caused? I’ve seen multiple games handle a number of moving parts with barely any lag but i’m not sure how.
The only other way I can think of is having everything handled on the client, passing through the server, and replicate it to all other clients using FireAllClients().
I don't really know how to move the projectiles, maybe TweeService or VectorMovers? Idk because I never used them.
As for the lag, you can fire the server the remote event, as well as creating a local projectile on the client and moving it as well. The server will handle the detection of the part hitting. This works well and doesnt usually break, chances of client and server conflicting about whether hit or not are 1 in 5000 iI think.
If you are moving and object from one place to another you should use object tweening but since you specify it as a projectile then you should use network ownership.