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

Is there a way to get 1 part in to everyones camera?

Asked by
Benqazx 108
8 years ago

i am trying to do a part that will be in everyones camera/screen but if one of the person touches the part it should only disappear from his camera/screen not the others. is there a way to do that?

0
Is your game Filtering Enabled? BobserLuck 367 — 8y
0
Can't answer but you want to parent it to each and every camera (Local Script) then when it's touched, remove from that persons camera. alphawolvess 1784 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

Maybe try some type of RemoteEvent system when the part is touched like this:

** Server Code**

local Part = workspace.Part -- Change to the actual part being touched
local RemoteEvent = game.ReplicatedStorage.RemoteEvent -- Change to the actual RemoteEvent

Part.Touched:connect(function(Hit)
    local P = game.Players:GetPlayerFromCharacter(Hit.Parent)
    if P then
        RemoteEvent:FireClient(P)
    end
end)

Client Code

local Part = workspace.CurrentCamera.Part -- Change to the part being deleted
local RemoteEvent = game.ReplicatedStorage.RemoteEvent -- Change to the actual RemoteEvent

RemoteEvent.OnClientEvent:connect(function()
    if Part then
        Part:Destroy()
    end
end)
0
thanks Benqazx 108 — 8y
Ad
Log in to vote
0
Answered by
Scriptecx 124
8 years ago

Instead of using Filtering Enabled, you could use local parts, but it isn't supported by Roblox. Place a part into the clients camera and the client should only be able to see it.

Answer this question