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

Putting parts into a player's camera

Asked by
OniiCh_n 410 Moderation Voter
10 years ago

How would I put part's into the Player's camera, and have the parts visible ONLY when they are in a certain spot? (Like in http://www.roblox.com/Dimensional-Door-Tech-Demo-place?id=48886383)

I talked to the owner about it, and he did say that he put parts into the player's camera... Trying to recreate that.

3 answers

Log in to vote
1
Answered by 10 years ago

As the first answerer said, you put the part into the Player's 'CurrentCamera' which is a property inside of Workspace(The more you know) and not some object in the Workspace, but anyhow, how will you do this? Well that's where I will show you:

part = Instance.new("Part", game.Workspace.CurrentCamera)
part.Position = Vector3.new(xVal, yVal, zVal)
part.Rotation = Vector3.new(xVal, yVal, zVal)

This would have to be used inside of a Local Script.

~~Hope I helped.

Ad
Log in to vote
2
Answered by 10 years ago

Well, using a Local Script you could put the parts in the players CurrentCamera (Game.Workspace.CurrentCamera) And only that person would be able to see those parts.

Log in to vote
0
Answered by
Kratos232 105
10 years ago

OK, next time try be more specific in the question... It kinda confused me, like you were purposely trying to obfuscate the question.

I know how to do it in a 1 script, but it'd be easier to explain this way.

OK, pretty simple really. Put a script in the Part that you want to be visible in an area. Change the script from print("Hello World!") to this:

while wait(0.05) do
if script.Parent.CFrame ~= CFrame.new(xAxis, yAxis, zAxis) then
script.Parent.Transparency = 1
else
script.Parent.Transparency = 0
end
end

And now, to put the brick in the player's Camera, you'll need a localscript. You can use this script for the localscript, unless you want something more complicated, then make your own.

LocalScript:

Part = PartLocationHere
Part.Parent = Game.Workspace.CurrentCamera

Well, I hope this helped.

  • Kratos232

Answer this question