How can I transfer information from a client to another without any server related method?

Hello, I was wondering if I could make something like “Character Follow Mouse” but visible also for other clients. Because the last time I tried to replicate this costed too much frames per second. Thanks.

Filtering Enabled by the way.

1 Like

Direct client replication is not possible. You should probably be using a RemoteEvent. If you want the entire server to see the replication, consider performing the changes on server than individual clients.

3 Likes

Yeah, just to expand on the reasoning behind what Operatik was saying - client to client communication can’t be done in a Filtering Enabled game because of the nature of FE. This is one of the major benefits of FE since one of the byproducts of this is that changes on a client (for example, someone using btools and deleting the map) don’t replicate to the other clients unless the server replicates the change to others. One of the negatives is that client to client communication without server involvement isn’t really possible. However, using the server as an intermediary isn’t difficult and the other benefits of FE make it well worth the hurdle. Remote Events, or if you store information in variable instances are an easy way to pass information along to the other clients.

2 Likes

Can you go more in-depth on the “Character follow mouse” idea? Your characters movement will automatically replicated in-terms of position and rotation. If you are receiving lag when trying to replicate something else using remote events consider firing the events less and then tween certain things you want on the clients.

Of course I can. You’ve probably seen few games doing it with R15 rigs where the Motor6Ds’ properties change according to the position of their mouse. Here’s a gif of it.

and I’ve tried to make it visible on other players with RemoteEvents. Which, lead to a huge increase of rate in script activity.

You can check the post I made few weeks ago Script Activity Rate not Dropping

But wouldn’t that increase average ping if it is being done very frequently?

The only thing you will have to replicate here is the position at which the mouse is at. Then once a client receives that data you would want to run the code which angles the characters torso and head downward. The position and rotation of your character will already replicate automatically. So as i stated before you would probably want to fire your remote less and do more on the clients in-terms if visuals. This model here does it with R15 however it might give you a little insight on how to tween the joints at an angle you want. https://www.roblox.com/library/2274201850/Character-look-at

1 Like

Without the server, you just can’t. If you could, that would be a security risk, as other clients could be vulnerable to exploits. The point is; The server has to be the middle man.

From how I see it, you have 2 options. Both of these options will give instant feedback to the client.

  • Change client’s properties. Fire the server. Server changes properties server-wide.

  • Change client’s properties. Fire the server. Server fires clients to change the properties.

The first one is less laggy, as it does not send a update through a remote event to every player every frame. Both of these options will give instant feedback to the user; They will see changes the second they move their mouse.

The parts position should replicate automatically, but if you want to also transmit the Motor6D values.

Script activity not dropping is an issue that has been addressed previously. The numbers are not real to the actual script rate. I’ve noticed and it is not a problem at all.

None of those are laggy. Clients and the server are passing pure data. You may be confusing lag with the natural delays that come from network traffic, since what you’re essentially creating is a network round trip (except the receiver is a different client).

The second option is usually more preferable so long as you aren’t doing the updates very frequently for instantaneous feedback. Pushing the work to the server increases what it’s responsible for at that time and it can’t take that as easily as the client can.

I simple low cost efficient method that might not look as fancy would be to a create a look up and look down animation, and then just play the look up animation while the mouse is above the players head and play the look down animation when the mouse is below the players head, as i said this may not look as nice but it will replicate as animations played from the client do replicate to other clients.

You can’t replicate most things on Roblox without using Remotes. Although I should note, there are some things that are replicated automatically in Roblox and these include: Character Movements, Animations, and IIRC Sounds (there are settings to turn this off IIRC). But yea, I hope this helped and clarified some things. :smile: IIRC = If I Remember Correctly

You do need to follow the standard client to server data model. If you find yourself updating players on every frame. Try to figure out how to optimize your code to do it every couple of frames or whenever a key event is triggered. For example, you could have a refresh rate on the clients. With that refresh rate, a Mouse.Move event could check if the time passed has exceeded your set refresh rate. (Keep track of time passed by utilizing tick() or incrementing a timer with deltatime on every step).

Already, with that being said. You’re taking in that some players may go idle. So we wouldn’t need to update their rotations if they’re not moving their mouse.

From there, it depends on how you want to tackle it. Have the server update the player angles or fire an event for all the clients to handle the movement. The movement could be done by using a simple lerp method. That way, every time the player moves their character. They will update their new coordinates and a lerp from the previous one can be done to smoothen out the frames. (Server or client side)