ViewportFrames are INSANELY cool

Поделиться
HTML-код
  • Опубликовано: 26 сен 2024
  • ViewportFrames seem daunting, but they're actually easy to use and allow you to create some neat GUI effects for your projects!
    Ever wanted to learn Roblox Studio & scripting? Check out my course:
    bit.ly/LuaScri...
    Use code LUA_CODING for 33% off!
    My linktree:
    linktr.ee/crus...
    Music used:
    Above The Clouds by | e s c p | www.escp.space
    escp-music.ban...
    Happy scripting!

Комментарии • 125

  • @DaikiCalla
    @DaikiCalla 7 месяцев назад +40

    To anybody who's curious, putting all the parts under a WorldModel makes the viewport have physics and much more - meaning that you can code characters and animate them in a ViewportFrame! It's really awesome stuff :)

    • @citizenfoffie7605
      @citizenfoffie7605 7 месяцев назад

      Is there a way to have it show chatbubbles?

    • @gloryowner1970
      @gloryowner1970 7 месяцев назад

      @@citizenfoffie7605 As Far as I know viewport frame is quite limited at the moment, and might not nesacarrily be able to show chat bubbles. (I am not sure myself however, maybe there is a way but I'm doubtful there is tho).

    • @miro_theburger
      @miro_theburger 5 месяцев назад

      ​@@citizenfoffie7605use the chat service i guess

    • @scratchyboiiii166
      @scratchyboiiii166 3 месяца назад

      Bro I know this sounds stupid but I've been trying to understand how to do this for like a year and you just solved my problem instantly. Thank you soooo much.

    • @DaikiCalla
      @DaikiCalla 3 месяца назад

      @@scratchyboiiii166 Glad that this inexperienced me was able to help you. 🤞

  • @Developer_Max
    @Developer_Max 7 месяцев назад +22

    that is very cool! cant wait till ur a multi-million youtuber

    • @crusherfire1
      @crusherfire1  7 месяцев назад +15

      you might die before that happens 🤨

    • @Arch-mv5te
      @Arch-mv5te 5 месяцев назад

      @@crusherfire1 the cooler part is that it WILL happen

  • @yarik_superpro
    @yarik_superpro 7 месяцев назад +57

    rip to sysyphus people who used viewportframes as highlights 💀

    • @alex342gwsturk8
      @alex342gwsturk8 7 месяцев назад +2

      box handle adornment:

    • @yarik_superpro
      @yarik_superpro 7 месяцев назад

      that does not highlight through object and it looks ugly@@alex342gwsturk8

    • @mogayt5156
      @mogayt5156 7 месяцев назад +2

      Wdym?

    • @baconheadhair6938
      @baconheadhair6938 5 месяцев назад

      wydm?

    • @yarik_superpro
      @yarik_superpro 5 месяцев назад

      @alex342gwsturk8 this doesn't go through walls and different effect overall.

  • @simplicityd8703
    @simplicityd8703 7 месяцев назад +3

    Genuinely one of the best tutorials I've seen on viewport frames. They were such a mystery to me, but this fully cleared it up. Thanks! :D

  • @AbstractAllen
    @AbstractAllen 7 месяцев назад +6

    Woah, this is a really good video. I learned more than I was supposed to.

  • @jotaye_bs
    @jotaye_bs 7 месяцев назад +15

    I was literally wondering some minutes ago how to use viewport frames and then you suddenly upload a video about these.. howwwwwwww?!?!???

    • @Haze_Nexus_real
      @Haze_Nexus_real 7 месяцев назад

      skillz

    • @NORMAL_ACCOUNT...
      @NORMAL_ACCOUNT... 7 месяцев назад

      very cool coincidence

    • @inconsistenttutorialuploader
      @inconsistenttutorialuploader 7 месяцев назад

      big data

    • @Haze_Nexus_real
      @Haze_Nexus_real 7 месяцев назад +1

      if you looked anything similar up before this, its likely RUclips detected that and recommended this since it just came out and you were looking for something similar.

    • @666thmoab
      @666thmoab 7 месяцев назад

      @@Haze_Nexus_realno they uploaded just as he was wondering

  • @DeletedAhmed
    @DeletedAhmed 7 месяцев назад +3

    so that's how those snapblox systems work
    thanks for tutorial keep up the good work

  • @EyeMadness
    @EyeMadness 4 месяца назад +1

    tysm, this will be used for good gaems

  • @extremedifficulty9786
    @extremedifficulty9786 7 месяцев назад +3

    thank you i have been waiting for this all the other youtubers have over complicated things

    • @rep4791
      @rep4791 7 месяцев назад

      ew

  • @JohnsonAttackThatBoomcannon
    @JohnsonAttackThatBoomcannon 6 месяцев назад

    I am don't know much about coding but this is really awesome this gives more opportunities to thoses who are willing to make games on roblox. I am trying to figure it out but, I am excited for what the future holds.

  • @MagAgent006-qj5nm
    @MagAgent006-qj5nm Месяц назад

    we making real working monitor with this one 🔥🔥

  • @MatteoP04ita
    @MatteoP04ita 7 месяцев назад

    Bro this is definitely the best video about viewportframes.
    Compliments for your voice too.

  • @Plehlowla
    @Plehlowla 3 месяца назад

    I like it, lol did catch me off guard that it didn't clone the clothes on the player 💀

  • @Eric.31107
    @Eric.31107 7 месяцев назад

    remember the time someone made a script that transformed your character into a literal viewport frame making you unkillable

  • @loogigd6193
    @loogigd6193 4 месяца назад

    idea: put this inside of a sniper scope and render whats in front in the frame to have the scope zoomed in but the rest of the screen not zoomed in

  • @LordAlgumaCoisa
    @LordAlgumaCoisa 7 месяцев назад +1

    they could be better but its better than nothing, before them i would use a module nexus the avenger had created for his roblox battle remake, it would display the 3d models as if it was on UI while it wasn't, viewport are a life saver for now

  • @illustration3406
    @illustration3406 7 месяцев назад +1

    Awesome video! Maybe a tutorial on CharacterController instances soon?

  • @Musa313
    @Musa313 7 месяцев назад

    It's bigger on the inside! great for creating TARDIS'es

  • @andreyromashchenko8967
    @andreyromashchenko8967 2 месяца назад

    Cool, now can you save that viewportframe picture to player’s inventory?

  • @DarthSpeedy
    @DarthSpeedy 7 месяцев назад

    This would be neat to use for realtime wanted posters lol

    • @baconheadhair6938
      @baconheadhair6938 5 месяцев назад

      I think that would be better with just images

  • @LeafyNebula
    @LeafyNebula 7 месяцев назад +2

    Thanks! I would pay for help on advancing this mechanic

    • @crusherfire1
      @crusherfire1  7 месяцев назад +2

      Whoa! Thank you for your support!

  • @WailTheIdiot
    @WailTheIdiot 7 месяцев назад +1

    YOOO YOUR 10 SUBS AWAY FROM 2K!!!

  • @the_chosen_one1235
    @the_chosen_one1235 7 месяцев назад +5

    AYEEE HE USED MY VIDEO IDEA

  • @Zion_k
    @Zion_k 7 месяцев назад

    Ive seen advanced ppl use them to create Portals and Functional reflections

  • @bananasfordays7760
    @bananasfordays7760 7 месяцев назад

    love ur content dude u need more subs

  • @mayronnaise-t8z
    @mayronnaise-t8z 5 месяцев назад

    I have an idea of part 2 for this: portals

  • @brum4
    @brum4 7 месяцев назад +2

    i think that it is possible to do realistic reflections

    • @crusherfire1
      @crusherfire1  7 месяцев назад +3

      definitely possible

    • @EpicPico0625
      @EpicPico0625 7 месяцев назад +1

      Perhaps make it an option so poopy computers don't die

  • @Typocat
    @Typocat 26 дней назад

    By the way, you can actually parent a Sky object to a viewport frame, and it will render it as if there was a sky!

  • @SimpleMade_
    @SimpleMade_ 2 месяца назад

    New title how to make a camera in game

  • @Ankitty10
    @Ankitty10 7 месяцев назад

    it can actualy can be used in FPS weapon system to make scopes lens'es show the far away and not the original camera decreases the FOV

  • @snooglebrosplayz
    @snooglebrosplayz 7 месяцев назад

    You should make a tutorial on inverse kinematics

  • @shomit0646
    @shomit0646 14 дней назад

    Can't you technically make a mirror if you make it a while loop?

  • @ajcharatrachoo6070
    @ajcharatrachoo6070 Месяц назад

    I got an error: Players.Aiden714T.PlayerGui.SurfaceGui.LocalScript:3: attempt to index nil with 'CFrame'

  • @TelaGamer
    @TelaGamer Месяц назад

    Can you save the studio file for us? This will fit my horror game so well!

  • @Pay2win_isnotcool
    @Pay2win_isnotcool 7 месяцев назад

    bro went from scp to development

  • @Hockets
    @Hockets 5 месяцев назад

    The must shitty thing about this feature is that surface gui wont work on viewportframe

  • @Roufoxx
    @Roufoxx 2 месяца назад +2

    Hey! If anyone is wondering why their avatar isn't appearing with clothes, it is because the shirts/t-shirts/pants doesn't get copied as they won't get detected by "GetPartBoundsInBox"
    To fix it, you need to handle characters seperately from the other parts and create a character model containing all the local players character objects.
    Here is my script that I made (different from the tutorial but can easily be edited)
    --[[ Game objects ]]
    local gui = script.Parent
    local char = game.Players.LocalPlayer.Character
    -- Creates a model that will contain the childrens of the local character.
    local Character1 = Instance.new("Model")
    Character1.Name = "CharacterModel"
    Character1.Parent = script.Parent.ViewportFrame
    game:GetService("RunService").RenderStepped:Connect(function()

    -- Creates the viewport camera
    local viewportCamera = Instance.new("Camera")
    viewportCamera.CFrame = gui.Adornee.CFrame
    viewportCamera.FieldOfView = 80
    gui.ViewportFrame.CurrentCamera = viewportCamera
    Character1:ClearAllChildren() -- Clears everything in the character model
    -- Clone and update the character parts (contained in the character model)
    for _, v in pairs(char:GetChildren()) do
    if v:IsA("BasePart") or v:IsA("Accessory") or v:IsA("Humanoid") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("CharacterMesh") then
    local bodyPartClone = v:Clone()
    if bodyPartClone:IsA("Humanoid") then
    bodyPartClone.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
    end
    bodyPartClone.Parent = Character1
    end
    end
    -- Clear all other children except the character model
    for _, child in ipairs(script.Parent.ViewportFrame:GetChildren()) do
    if child ~= Character1 then
    child:Destroy()
    end
    end


    -- Kinda janky but stores all the parts in the workspace (excluding the terrain) in a table
    local parts = {}
    for _, v in pairs(workspace:GetChildren()) do
    if v:IsA("BasePart") and v.Name ~= "Terrain" then
    print(v.Name)
    table.insert(parts, v)
    end
    end

    -- Puts all the parts from the "parts" table to the viewport frame excluding the character parts (Bad code but still works I guess)
    for _, part in pairs(parts) do
    if not char:FindFirstChild(part.Name) then
    local clone = part:Clone()
    clone.Parent = script.Parent.ViewportFrame
    end
    end
    end)

  • @ps_lol
    @ps_lol 7 месяцев назад

    mirror system is good
    u can make their camera into mirror but it has issue, u can see ur own inside so yea is sad

  • @Roufoxx
    @Roufoxx 2 месяца назад

    Hey!
    If anyone is curious why their avatar appears naked in the ViewportFrame, it is because there isn't any Humanoid/Character model
    I made a little script that fixes this problem. Feel free to edit it to your liking!
    ////////////////////////////////////////////
    --[[ Game objects ]]--
    local gui = script.Parent
    local char = game.Players.LocalPlayer.Character
    -- Creates a model that will contain the childrens of the local character.
    local Character1 = Instance.new("Model")
    Character1.Name = "CharacterModel"
    Character1.Parent = script.Parent.ViewportFrame
    game:GetService("RunService").RenderStepped:Connect(function()

    -- Creates the viewport camera
    local viewportCamera = Instance.new("Camera")
    viewportCamera.CFrame = gui.Adornee.CFrame
    viewportCamera.FieldOfView = 80
    gui.ViewportFrame.CurrentCamera = viewportCamera
    Character1:ClearAllChildren() -- Clears everything in the character model
    -- Clone and update the character parts (contained in the character model)
    for _, v in pairs(char:GetChildren()) do
    if v:IsA("BasePart") or v:IsA("Accessory") or v:IsA("Humanoid") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("CharacterMesh") then
    local bodyPartClone = v:Clone()
    if bodyPartClone:IsA("Humanoid") then
    bodyPartClone.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
    end
    bodyPartClone.Parent = Character1
    end
    end
    -- Clear all other children except the character model
    for _, child in ipairs(script.Parent.ViewportFrame:GetChildren()) do
    if child ~= Character1 then
    child:Destroy()
    end
    end


    -- Kinda janky but stores all the parts in the workspace (excluding the terrain) in a table
    local parts = {}
    for _, v in pairs(workspace:GetChildren()) do
    if v:IsA("BasePart") and v.Name ~= "Terrain" then
    print(v.Name)
    table.insert(parts, v)
    end
    end

    -- Puts all the parts from the "parts" table to the viewport frame excluding the character parts (Bad code but still works I guess)
    for _, part in pairs(parts) do
    if not char:FindFirstChild(part.Name) then
    local clone = part:Clone()
    clone.Parent = script.Parent.ViewportFrame
    end
    end
    end)

    • @lemurboi723
      @lemurboi723 Месяц назад

      Hey, is there a way for this to work as a server script? So other people could see you displaying yourself on the screen with like a camera someplace else

    • @Roufoxx
      @Roufoxx Месяц назад

      @@lemurboi723 Hmm... I'm not home right now but there should be a way to do it

    • @lemurboi723
      @lemurboi723 Месяц назад

      @@Roufoxx i found out, I just made it loop duplicate so everyone sees the same thing regardless like a mirror, but I'm gonna use it like a remote holographic display

    • @Roufoxx
      @Roufoxx Месяц назад

      @@lemurboi723 Ok cool!

  • @Mavve69
    @Mavve69 7 месяцев назад

    *How would one make a disposable camera, or just a normal camera, with this?*
    How would I incorporate the movement and the fact that it’s being held?
    And, how would I make it capture more then just a small portion of the nearby area?

  • @myriadtechrepair1191
    @myriadtechrepair1191 5 месяцев назад

    I have a problem! xD It thinks my character is naked.

  • @matrixgeg
    @matrixgeg 7 месяцев назад +1

    can i do it with 2d not 3d?

  • @user-wy2el6kb1l
    @user-wy2el6kb1l 7 месяцев назад

    why does only my head show instead of my whole body

  • @Warp3326
    @Warp3326 7 месяцев назад

    you have the same colors as my roblox outfit lol

  • @clapstheplug3476
    @clapstheplug3476 3 месяца назад

    How can i make it update everytime the player moves?

  • @proglitcher1231
    @proglitcher1231 6 месяцев назад +1

    6:31 i just tested and i had no clothes what do I do 💀

    • @SHOIOTERB
      @SHOIOTERB 5 месяцев назад

      Because it puts every single part in the portframe without the full model and humanoid

  • @adamainouss6889
    @adamainouss6889 7 месяцев назад

    So it could be possible to have a camera system without having to move the character's cam to the position and simply displaying it on some kind of part (like a screen) ? (ofc with bad quality bu why not)

    • @crusherfire1
      @crusherfire1  7 месяцев назад

      yeah, if you want a camera system to display on a part via surface GUI
      however, lots of viewport frames can start to cause performance issues, and it wouldn't make sense to use viewport frames to replace an on-screen camera system

  • @doge_man3367
    @doge_man3367 7 месяцев назад

    Thx bro

  • @TheOgKingEnderKill
    @TheOgKingEnderKill 7 месяцев назад +1

    why is my avatar naked when i take a photo

    • @crusherfire1
      @crusherfire1  7 месяцев назад

      because clothing is based on instances that are not decals, so you would have to copy the entire character models rather than the parts individually

    • @TheOgKingEnderKill
      @TheOgKingEnderKill 7 месяцев назад +1

      @@crusherfire1 how can i do that

  • @ArnyDab
    @ArnyDab 7 месяцев назад +1

    Help. What is adornee?

    • @crusherfire1
      @crusherfire1  7 месяцев назад +1

      Adornee is a property that refers to the object that the GUI is going to be adorned onto.
      Adorn means "to enhance the appearance of", so the object that is having its appearance enhanced is the adornee.
      The main utility of the property is the ability to place the SurfaceGui anywhere in your game without it needing to directly be a child of a certain part. This allows us to place SurfaceGuis in StarterGui.
      If there is no adornee property set, the SurfaceGui will adorn onto it's parent (if it's a part) by default.

    • @ArnyDab
      @ArnyDab 7 месяцев назад

      @@crusherfire1 Thanks!

  • @cbob81514
    @cbob81514 7 месяцев назад

    it deleted all my clothes, i guess i need to fix it

  • @C47R4_
    @C47R4_ 2 месяца назад

    what u usin to make script editor look like that share w me pls

  • @TheOgKingEnderKill
    @TheOgKingEnderKill 7 месяцев назад +1

    what are youre Studio settings? I really like them

    • @crusherfire1
      @crusherfire1  7 месяцев назад +2

      Check out this plugin for some script editor presets:
      create.roblox.com/store/asset/3617323299

    • @TheOgKingEnderKill
      @TheOgKingEnderKill 7 месяцев назад

      @@crusherfire1 thanks

  • @Vanpirth
    @Vanpirth 4 месяца назад

    how do i clone cloths XD

  • @UselessWorm
    @UselessWorm 7 месяцев назад

    Why does my character appear not to have clothing?

    • @crusherfire1
      @crusherfire1  7 месяцев назад +1

      Because character clothing is stored in separate instances like Shirt and Pants, so in order to copy everything in a character, including clothing, you'd have to copy the whole character model instead of individual parts.

  • @Hittzo
    @Hittzo 7 месяцев назад

    ok

  • @PreamOffical
    @PreamOffical 7 месяцев назад

    imagen making tik tok or youtube shorts in roblox

  • @666thmoab
    @666thmoab 7 месяцев назад

    Scripts dont run idk why

  • @m3s5_0f_numb3r5
    @m3s5_0f_numb3r5 7 месяцев назад

    This would have been so helpful to me if I didn’t already know how ViewportFrames work. 😢
    Also I think it’s really stupid that we can’t have Lighting Effects for ViewportFrames.
    But what isn’t stupid is this video. 👍

    • @crusherfire1
      @crusherfire1  7 месяцев назад

      maybe in the future when Roblox improves their engine

    • @m3s5_0f_numb3r5
      @m3s5_0f_numb3r5 7 месяцев назад

      @@crusherfire1 That’s assuming they ever will. (They won’t, but they will make it worse ☺️)

  • @owenrossier3500
    @owenrossier3500 7 месяцев назад

    why did it made my character naked?

    • @crusherfire1
      @crusherfire1  7 месяцев назад

      it copies only the parts over and the clothing instances are not parts, so you would need to detect if its a character, and if so, just copy the whole character (and delete any scripts inside of the copied character)

    • @owenrossier3500
      @owenrossier3500 7 месяцев назад

      @crusherfire1 what does the script look like with the problem because it threw me an error.

  • @mr_stingers-u4f
    @mr_stingers-u4f 2 месяца назад

    Where the fuck is the link

  • @madnessmyth
    @madnessmyth 7 месяцев назад

    Textures are bugged in ViewportFrames.

    • @crusherfire1
      @crusherfire1  7 месяцев назад

      You just need to copy the whole character model (which contains instances like Pants and Shirt)

    • @potolog101
      @potolog101 7 месяцев назад

      @@crusherfire1 or just copy the pants and shirts along with the others parts

    • @madnessmyth
      @madnessmyth 7 месяцев назад

      @@crusherfire1 Oh, right, shirt and pants aint a part.. whoops.. But textures are broken. I tested that.

    • @Idiskjsjsjjsjsjsbhshshshsh
      @Idiskjsjsjjsjsjsbhshshshsh 7 месяцев назад

      @@potolog101 Won't work, it has to be a model with a humanoid.

    • @potolog101
      @potolog101 7 месяцев назад

      @@Idiskjsjsjjsjsjsbhshshshsh keyword : OTHER parts (referring as in instances)

  • @nullagoat
    @nullagoat 7 месяцев назад

    do you have a discord?

    • @crusherfire1
      @crusherfire1  7 месяцев назад

      I have a server, but it's not public

  • @idiotthereal
    @idiotthereal 7 месяцев назад

    i actuallly think its quite unpolished, it doesnt have many features that should be in

    • @crusherfire1
      @crusherfire1  7 месяцев назад

      yeah, roblox can totally add a whole bunch of additional features to viewport frames

  • @XaneMyers
    @XaneMyers 7 месяцев назад +4

    I wouldn't really say that ViewportFrames are particularly easy to use; The only way to make a part show up is to move it into one, then it feels like the part went to another dimension, making it harder than it should be to line it up with the viewport's camera.
    Another thing that makes ViewportFrames an intermediate difficulty instance is Team Create. For some reason, cameras are removed automatically if you use this feature (which Roblox really wants people to use). If you're making a game that uses it, you pretty much have to create the camera using a script and guess where it's going to point during play-testing.
    I've used one of these myself without issues since I kind of know how to, but these gotchas may throw some developers off. (I used a ViewportFrame for my loading screen, which shows the player's character posing on a platform while it loads the next place.)

    • @codes8300
      @codes8300 7 месяцев назад +2

      You don't need to guess where the camera is pointing. You just need to set the CFrame of where you want to position and looking at. or a hacky way to do it is to create a "Reference" Part to where the camera should be placed and looking. You can visualize the camera look direction by just enabling the the reference part's "Show Orientation Indicator" on the Context Menu.

    • @ExoticFoxy
      @ExoticFoxy 7 месяцев назад

      Bro can't cook