|
| 15 May 2017 06:28 PM |
With a turret I'm creating with FE on, I am connecting the mouse's move function to a script that updates the turret's rotation.
The localscript gets the mouse's position and sends it to the server for turret rotating.
Since remoteevents have a request limit, the turret would start lagging to the client after using it for a couple seconds.
How would you guys approach this problem?
Game: https://www.roblox.com/games/270640895/- |
|
|
| Report Abuse |
|
|
|
| 15 May 2017 06:42 PM |
| Set the network ownership of the turret to the player. |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 May 2017 06:57 PM |
| it would work, but atm my turret parts are welded to an anchored part so it doesn't work |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 May 2017 09:38 PM |
| How often are you firing your rE? |
|
|
| Report Abuse |
|
|
|
| 17 May 2017 05:40 AM |
I ended up using the network ownership idea.
I WAS firing the remote event every time the mouse moved by connecting it to the Mouse.Move function. |
|
|
| Report Abuse |
|
|
|
| 17 May 2017 06:26 AM |
You could also make it so that it's click based - the turret only rotates once the user clicks.
never ever never ever spam Remotes. |
|
|
| Report Abuse |
|
|
|
| 18 May 2017 07:51 PM |
^ BlueWizard, no wonder. You should make it fire at most ever RenderStepped or Heartbeat, not every time the mouse moves. |
|
|
| Report Abuse |
|
|
|
| 18 May 2017 09:04 PM |
| no, that's the same thing it would still lag |
|
|
| Report Abuse |
|
|
|
| 21 May 2017 12:18 AM |
| Hmmm, maybe rotate the turret locally? |
|
|
| Report Abuse |
|
|
|
| 21 May 2017 12:19 AM |
| Then when the player clicks the mouse to shoot, the local script can pass the turret tip location to the server, and the server can verify if it's a reasonable location and if so, then fire from the position to the mouse position. |
|
|
| Report Abuse |
|
|
|
| 21 May 2017 09:36 AM |
| I already have a fix that I've been using: using set network ownership and rotating the turret on the client. |
|
|
| Report Abuse |
|
|
Spathi
|
  |
| Joined: 18 Nov 2013 |
| Total Posts: 14776 |
|
| |
|