Help on a WIP tunneling system

  1. What do you want to achieve? Keep it simple and clear!
    A method for going about a tunneling system, where you’re in a claustraphobic, small space where only one person can go forwards or backwards. If they collide with another player, the other player pushes them (in the direction their moving) at 0.5x the speed they normally would, and the resulting player would move at this speed too.

  2. What is the issue? Include screenshots / videos if possible!
    Server replication, to put it to short. I’m just not sure how to go about it because players shouldnt be able to go past/inside each other, so collisions should be on. This creates an endless array of problems. The way I’m currently doing it is by using Align Pos & Orientation setting every frame (on the client), which (by the cause of network ownership) replicates to the server perfectly, but when players collide it can easily glitches out.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Here’s my only hypothetical method for going about this, but I personally feel like there has to be something easier and more efficient:

  • Have a configuration/folder thingy to store the variables: the tunnel the player is in, the cast line that the player is on (tunnels are split into cast lines to travel through, like zip lines kind of), and the distance they’ve travelled through that cast line
  • Have requests sent from the client every frame, sending data for these 3 variables constantly
  • Have all clients individually visually interpret these variables and replicate replication (if that makes sense) by having some of sort of clone of every player character in the game that only is visible when the player is tunnelling and positioning it manually to where it should be, so that if the client meets this player in a tunnel their push force is instant and not affected by their ping

Thank you so much for reading! Any questions I’ll answer as best as I can, and I’d really appreciate help on this :slight_smile:

1 Like

Let’s take a look at your username buddy. It is script support I’m perplexed by your unneeded humourous remark.

1 Like

No need for your own unnecessary remarks. Obviously, we won’t just give you the script (which you haven’t asked for, but I digress), but we will help with the solution.
This shouldn’t be too difficult if you resort to messing with humanoid WalkSpeed, which you can set on the server. If you have branching tunnels, using waypoints that are broadcasted to the client will help.Then, just overlay a crawling animation to each player and that should work.

1 Like

You raise a fair point. But my tunneling system, as aforementioned, consists of simple backwards and forwards movement. Introducing walkspeed into this implies the players have free movement and would like cause much worse teething problems.

1 Like

You could restrict player orientation to only a waypoint’s orientation. This makes it a lot easier to handle player movement.

1 Like

Okay that’s true, but then what about the whole pushing mechanic I mentioned? Would it be possible to change the physics of the characters so they can naturally push each other?

1 Like

Wouldn’t change anything. Use magnitude checks or raycasts to check when players are touching / too close and set the walkspeed accordingly.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.