Moving NonCharacter as Main Character (Tank controls)

I am making a top down view tank shooting game, and I want to set basic controls (forward, backwards, left, right).

I have tried moving it with CFrames but it clips through walls, when using collide functions to disallow this, I came across another problem which is that its laggy due to movement on the server. Since the part is anchored, I cannot set it’s network ownership either.

How could I communicate client-server and also move the tank so it replicates to everyone? Thanks!

bump

Your best shot is just to use physics constraint and a lot of ray cast based detection to avoid clipping through walls.

2 Likes

You could use a Raycast to detect obstacles and stop the tank or adjust its path

For movement, I think it’s best to let the client handle it with Network Ownership. Running it on the server can cause delays for players with high ping. Alternatively, you could have the client control movement, send updates with FireServer, and let the server update other players with FireClient if the player is within range

1 Like

Use raycast checks as people have stated

That is fine. You can have laggy movement on server to a degree. Then do client prediction to animate/lerp the movements on the client side.

1 Like