Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Ways to get local Lighting? [Answered]

Asked by
Destrings 406 Moderation Voter
10 years ago

It's there an official way to do client independent lighting? I realized it can be done enabling FilteringEnabled since changes doesn't replicate. But can it be done in another way?

EDIT: Clarification:

What I want is the ability to change the lighting settings in a client without affecting other clients. I managed to do that exploiting the proprieties of FilteringEnabled, if it is enabled the changes done by a client won't replicate; that means we can change lighting settings in a client and it won't replicate to others. It works, but it's kinda hackish, and if a game relies on client replication then you can't use it. What I want is another way of getting this without enabling FilteringEnabled.

2 answers

Log in to vote
2
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

Your method of using FilteringEnabled is the most reliable and only "supported" method for local Lighting. If you are referring to light objects, you can use them the same way you would normally create localparts.

If you want to have local Lighting without using FilteringEnabled, you'll have to exploit the inherent latency between the client and the server.

Here's an example place that does this.

The way this works is simple: using the Changed event of Lighting in a LocalScript allows you to set the Lighting for one Client independently of all others. This works because of latency.

When you update one client, that update (with FilteringEnabled enabled) replicates to the server, which then replicates to the other clients. These two replications take time. Very little, but more than it takes to update Lighting on the client's computer. So, this happens:

With two players:

Player1's Lighting updates. Player1's Lighting is replicated to the Server. Player1's Lighting is replicated to Player2. Player2's Lighting.Changed event fires, updating the Lighting to Player2's settings. Player2's Lighting is replicated to the Server.

And so on. With more players, this simply happens more frequently. It's also wicked fast, on the order of milliseconds.

0
I wfote my anserr on a phone woth slow internet connection q.q HexC3D 830 — 10y
1
That's even more hackish than using FilteringEnabled. But it works, so upvote for you. Destrings 406 — 10y
Ad
Log in to vote
-1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

Store it in the CurrentCamera

0
You can't store lighting in the camera. I'm talking about client side lighting, not client side parts Destrings 406 — 10y
0
Actually, you *can* store light objects in the Camera, or in the PlayerGui, or wherever else you can get LocalParts, you just have to Parent them to a local part for them to be visible. adark 5487 — 10y

Answer this question