When an obstacle is put in the map it is inserted into a table called obstacles.
So… Currently the way the game detects obstacles is through touched events.
The server routes touched events to every cart’s parts.
If one of the hits table.find(obstacles, hit) then
it destroys the cart and kills the player.
The effect is that other players can see the cart crashing and destroying since the server handles it.
However sometimes a delay might mean that u hit the tree and then 5 seconds later u get destroyed.
Should I instead have the touched events be in local scripts and then fired to the server? Wouldn’t that be much much faster? Basically an invokeserver function will return the table of obstacles stored in the serverscripts and then do action if it finds that it hit an obstacle
Also what about optimizing.
Go see the game and let me know if it is laggy or not please help!
It seems that your game is already really successful! I’ve been playing it for a little, and many people play it. You should definitely be proud. Some advice I can give:
Try to make the GUI look a bit better
Add trees at lobby
Maybe add a blur / imrpove lighting
Add more products in the shop + an economy (coins can be gained via survival distance, bought with robux, etc)
Advertise a little
Turn off player collisions as well as cart collisions (You can hold intermission votes where players can vote on whether or not having collisions before the round starts)
Map votes / Gamemode votes before rounds start (This will add more player - game interaction, which is good)
You should also consider lowering the server player amounts, since it does cause a lot of lag when you have 45 carts driving around.
Also, this lag that you talk about is probably ROBLOX Server lag from how you describe it.
ya there is a bit of lag when colliding with a tree so I’d suggest checking in a local script and the server
this way even if there’s an exploiter who doesn’t wanna tell the server about them not having car insurance, the server can still know! (and it’s practically required so that other players can see it lol) B))
not sure how this would work if you’re gonna add the option to hide car discombobulation to reduce lag for laggy players. Maybe send a signal to all of the other clients via remote event to handle rendering of the explosion that way.
ok byeee merry christmas or happy holidays!
edit: oh yeah just noticed, there might be a way to just afk and get coins or something (even tho you haven’t added them yet so idk)
Also you could create a camera shake/wiggle when another player nearby explodes. If player’s don’t like the camera lagging behind and the camera shake, you should create a setting where they can disable these effects.