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

3D Camera mode of player in GUI ?

Asked by 4 years ago

I know the basic of scripting but I have no clue how to do this https://youtu.be/WlakBzP9QwE
time: 0:05 So how he does the 3D Player which follow up your cursor in gui ?

1 answer

Log in to vote
0
Answered by
Dfzoz 489 Moderation Voter
4 years ago
Edited 4 years ago

Edit: chess123 commmented about the ViewportFrame, which I didnt know about, Try it out!-- He probably created a copy of the character ClientSide, so others can't see it. Then, he used RenderStepped to update the position of the character to a position where it looks like its on a GUI. He used renderstepped because it updates every frame the game renders. Some details should be taken in account for aesthetic reasons, like removing CastShadow on his parts so it don't cast a shadow below him. The following code lacks some details but it shows what he could have done:

local renderService = game:GetService("RunService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local birb = Instance.new("Part")
birb.Name = "Birb"
birb.Anchored = true
birb.CanCollide = false
birb.Size = Vector3.new(1,1,1)
local mesh = Instance.new("SpecialMesh")
mesh.Parent = birb
mesh.Scale = Vector3.new(1,1,1)
mesh.MeshId = "http://www.roblox.com/asset/?id=329798434"
mesh.TextureId = "http://www.roblox.com/asset/?id=329790966"
birb.Parent = workspace
local camera = workspace.CurrentCamera
renderService.RenderStepped:connect(function()
    birb.CFrame = CFrame.new(camera.CFrame.Position+(camera.CFrame.LookVector*10)+(camera.CFrame.RightVector*10),camera.CFrame.Position)
end)
0
Minor note: most likely a ViewportFrame was used, see https://developer.roblox.com/en-us/api-reference/class/ViewportFrame chess123mate 5873 — 4y
0
Wow, didnt know about that. Wonder when it was implemented because when I tried making the renderstepped thing it was for this Dfzoz 489 — 4y
Ad

Answer this question