Tween Service - Roblox Advanced Scripting #12

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ม.ค. 2025

ความคิดเห็น • 77

  • @Likeable_Emmec
    @Likeable_Emmec ปีที่แล้ว +29

    I feel a bit ashamed saying this considering i have ~3 years of experience with Lua but I never really dabbled with TweenService! I didn't even know TweenInfo was a thing...😅Very informative, keep creating!

    • @BrawlDevRBLX
      @BrawlDevRBLX  ปีที่แล้ว +11

      Thanks dude! Hope you stick around for future vids to come! :)

  • @CodeByteCrafter
    @CodeByteCrafter 6 หลายเดือนก่อน +3

    HELPPP WHY ARE YOUR TURTORIALS SOOO GOOD!!!! I ALMOST UNDERSTOOD EVERY SINGLE TOPIC U EXPLAINED IN 1ST TRY

  • @PanMan302
    @PanMan302 7 หลายเดือนก่อน +8

    This has to be one of the BEST channels for learning Roblox luau for everyone before I watched TheDevKing but, this is a lot better. I will watch probably every video on this channel more than once to learn as much as I possibly can thank you for making each and every one of these tutorials for me and everyone else to advance to become a pro coder u deserve more than 100k subs u deserve even more than that u actually deserve more than 1 million subs just thank u for helping me and probably everyone else to get so much better at Roblox luau

  • @dylanb1997
    @dylanb1997 7 หลายเดือนก่อน +1

    You definitely just earned a sub dude, I couldn't really get over tweening until I watched this. You actually might have expanded my library of Lua!

  • @Gachims
    @Gachims หลายเดือนก่อน

    Aw I daresay your content is pretty good!I simply desire more!Every time I might feel discouraged clicking into new episodes,thinking that it will be overloading again,the intro always blends my mind in without having too much stress.This is so good.

  • @infinitywaffles7343
    @infinitywaffles7343 7 หลายเดือนก่อน +3

    I was recently watching TheDevKing tutorials and i got stuck in a video because it was VERY outdated (2019) but then I found out your channel and all of my questions have been answered. Thanks BrawlDev 👻

    • @Hgjuildoo
      @Hgjuildoo 6 หลายเดือนก่อน

      me too

    • @fandedeto4603
      @fandedeto4603 3 หลายเดือนก่อน

      BrawlDev >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>TheDevKing

  • @themainejermaine
    @themainejermaine ปีที่แล้ว +2

    0:09 my favourite part of the video

    • @MrxDerpReal
      @MrxDerpReal 7 หลายเดือนก่อน

      BRUHHH

    • @الخلبوصة
      @الخلبوصة 4 หลายเดือนก่อน +1

      do you actually learn scripting or are you just watching

    • @themainejermaine
      @themainejermaine 4 หลายเดือนก่อน

      @@الخلبوصة when I commented this I was learning but I don't anymore

    • @الخلبوصة
      @الخلبوصة 4 หลายเดือนก่อน

      oh ok

  • @boom_fish_blocky
    @boom_fish_blocky 6 หลายเดือนก่อน +2

    Now we only need 2D UI Tweening tutorial! :3

    • @BernardoVeloso-123
      @BernardoVeloso-123 10 วันที่ผ่านมา +2

      guess its the same, u just change vector3 for udim2

  • @jomprobepro1724
    @jomprobepro1724 7 หลายเดือนก่อน +1

    wow these vids are great!

  • @ryxzgames
    @ryxzgames 4 หลายเดือนก่อน +2

    To repeat it infinitely, you can set the repeatCount to -1 and it will replay infinitely.

  • @pedroj.8013
    @pedroj.8013 9 วันที่ผ่านมา

    nice tutorial, i incremented this tweenservice on my contextactionservice script 🤗
    local CAS = game:GetService("ContextActionService")
    local plr = game.Players.LocalPlayer
    local orb = script.Parent
    local mouse = plr:GetMouse()
    local sound = orb.Magic_Sprinkle
    local teleportDistanceLimit = 200
    local cooldown = false
    local TS = game:GetService("TweenService")
    local Bar = plr.PlayerGui.ScreenGui.ImageLabel
    local function Click(actionName, inputState)
    if cooldown then return end
    if actionName == "Teleport" and inputState == Enum.UserInputState.Begin then
    local targetPosition = mouse.Hit and mouse.Hit.Position
    if not targetPosition then return end
    local character = plr.Character
    local humanoidRootPart = character and character:FindFirstChild("HumanoidRootPart")
    if not humanoidRootPart then return end
    local distance = (humanoidRootPart.Position - targetPosition).Magnitude
    if distance > teleportDistanceLimit then return end
    cooldown = true

    sound:Play()
    humanoidRootPart.CFrame = CFrame.new(targetPosition)

    local tweenInfo = TweenInfo.new(1.8)

    local actualTween = TS:Create(Bar, tweenInfo, {Size = UDim2.new(0.01, 0, 0, 0)})

    actualTween:Play()

    actualTween.Completed:Wait()

    Bar.Size = UDim2.new(0.01, 0, -0.2, 0)

    task.wait(.2)

    cooldown = false
    end
    end
    orb.Equipped:Connect(function()
    Bar.Parent.Enabled = true
    CAS:BindAction("Teleport", Click, false, Enum.UserInputType.MouseButton1)
    end)
    orb.Unequipped:Connect(function()
    Bar.Parent.Enabled = false
    CAS:UnbindAction("Teleport")
    end)

  • @truth7225
    @truth7225 3 หลายเดือนก่อน +1

    Can you use tween for like a weapon? Like to make it longer or something for an animation or is there another way to go about that

  • @lucabacha
    @lucabacha 3 วันที่ผ่านมา

    tweenService is great!

  • @EpicTurbulance
    @EpicTurbulance 4 หลายเดือนก่อน

    Thank you very much.

  • @bobthebuilder-do1rt
    @bobthebuilder-do1rt 2 หลายเดือนก่อน

    Your so funny 🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣😂😂😂😂😂😂😂😂😂😂
    its a compliment.

  • @terraria_pog2355
    @terraria_pog2355 หลายเดือนก่อน +1

    diddy's second favorite function

    • @RealSecretBL
      @RealSecretBL หลายเดือนก่อน +1

      You wild for that 😂

  • @MU23ii
    @MU23ii 2 หลายเดือนก่อน +1

    Wait so Tween Service is move, scale, rotate and color triggers from geometry dash? Cool.

    • @TheOnlyTomira
      @TheOnlyTomira หลายเดือนก่อน +1

      I THOUGHT THE SAME THING

  • @Bengoo_
    @Bengoo_ 9 หลายเดือนก่อน

    At 7:32 what plugin do you use to display how far you moved a part?

    • @BrawlDevRBLX
      @BrawlDevRBLX  9 หลายเดือนก่อน

      I think it's a beta feature, I could be wrong about that. But as far as I know, I'm not using any plugin lol

    • @Bengoo_
      @Bengoo_ 9 หลายเดือนก่อน

      @@BrawlDevRBLX That clears up a lot, and I found it too thanks!

    • @ikay5835
      @ikay5835 6 หลายเดือนก่อน

      @@Bengoo_Where did u find it?

  • @BernardoVeloso-123
    @BernardoVeloso-123 10 วันที่ผ่านมา +2

    local tweenService = game:GetService("TweenService")
    local button = script.Parent
    local part = game.Workspace.SpawnLocation
    local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Exponential)
    button.MouseEnter:Connect(function()
    if button.BackgroundColor3 == Color3.new(0, 0, 0) then
    button.BackgroundTransparency = 0
    end
    end)
    button.MouseLeave:Connect(function()
    if button.BackgroundColor3 == Color3.new(0, 0, 0) then
    button.BackgroundTransparency = 0.5
    end
    end)
    button.MouseButton1Click:Connect(function()
    button.Interactable = false
    button.Text = "Tween running..."
    button.BackgroundTransparency = 0

    local randomRed = math.random(1, 255) / 255
    local randomGreen = math.random(1, 255) / 255
    local randomBlue = math.random(1, 255) / 255

    local partGoal = {
    Position = part.Position + Vector3.new(0, 0, 50),
    Color = Color3.new(randomRed, randomGreen, randomBlue)
    }
    local buttonGoal = {
    BackgroundColor3 = Color3.new(randomRed, randomGreen, randomBlue)
    }

    local buttonTween = tweenService:Create(button, tweenInfo, buttonGoal)
    buttonTween:Play()

    local partTween = tweenService:Create(part, tweenInfo, partGoal)
    partTween:Play()

    partTween.Completed:Connect(function()
    button.Interactable = true
    button.Text = "Start tween!"
    button.BackgroundTransparency = 0.5
    end)
    end)

  • @TrygveJF
    @TrygveJF 8 หลายเดือนก่อน +1

    Hey! Loved the video. But I wonder if there's a way to make multiple tweens work together as one, kinda? Like for example a cutscene tween for the camera, and make the camera smoothly move with the first tween, and then make it continue in a second tween without it making a sudden move/turn? Like moving in a circle around a part for example instead of it moving in a direct line and making sudden moves to move around the part
    I wrote this at 12am and was pretty tired, so let me know if there was something that didn't make sense 😅

    • @BrawlDevRBLX
      @BrawlDevRBLX  8 หลายเดือนก่อน +1

      You can have multiple tweens playing at once, but they need to fulfill their own goals. In your example with smooth cameras rotating around a part, tweenservice might not be the way. TweenService has a starting point and an end goal it must reach. A tween can have multiple goals, but you can't expect a smooth transition from one tween to another because it stops once it reaches its goals. If you want a quick fix, you can use loops to know where to position the cam around in a circle. A more complicated, but recommended, approach is using bezier curves. I hope this helps!

    • @TrygveJF
      @TrygveJF 8 หลายเดือนก่อน +1

      @@BrawlDevRBLX I see
      Thanks for telling me! ❤️

  • @SameForYouWasTaken
    @SameForYouWasTaken ปีที่แล้ว

    Can you do floatcurve for next video? I feel like people would want more curvy tweens for most stuff and I am interested on how to do that. Cheers

  • @ARCT1Q
    @ARCT1Q 9 หลายเดือนก่อน +1

    Hi great tutorial as always! can you please bring the challenges back? i feel like they forced me to apply what i learnt from the video and helped me to learnt hem properly

    • @BrawlDevRBLX
      @BrawlDevRBLX  9 หลายเดือนก่อน +1

      You're not the only one who suggested to bring them back. I will be experimenting with newer tutorials by adding some sort of challenge at the end. We'll see how they go!

  • @hovarkgames5232
    @hovarkgames5232 7 หลายเดือนก่อน

    instead of a while loop, you can put -1 in repeatCount and then true

  • @cubicallystupid
    @cubicallystupid ปีที่แล้ว +1

    This was very helpful

  • @𠮟
    @𠮟 5 หลายเดือนก่อน

    thank you

  • @Drag0n_k
    @Drag0n_k หลายเดือนก่อน

    BIG HELP THX BIG BRO

  • @brezow
    @brezow ปีที่แล้ว

    i like your video

  • @ImnotgolfeYi
    @ImnotgolfeYi 6 หลายเดือนก่อน

    TYSMMM

  • @coolkid7377
    @coolkid7377 7 หลายเดือนก่อน

    How would you organize doing this series for beginners? What I mean is that I'm cramming all your tutorials into my studio and just leaving the script tabs open for each code you taught. Obviously, this was a bad idea to do lmao.

    • @Diego-ye2os
      @Diego-ye2os 6 หลายเดือนก่อน

      just disable the old scripts

    • @coolkid7377
      @coolkid7377 6 หลายเดือนก่อน

      @@Diego-ye2os i just created a new account and made each tutorial its own game. far much better imo. plus since this is a new account meant for specifically scripting, its way easy to access

    • @SantaPo
      @SantaPo 12 วันที่ผ่านมา

      @@coolkid7377 that is not a good way to organize your scripts

    • @coolkid7377
      @coolkid7377 11 วันที่ผ่านมา

      @@SantaPo what would you suggest

    • @SantaPo
      @SantaPo 11 วันที่ผ่านมา +1

      @@coolkid7377 disabling them and if you want to keep them organized put them in folders, a new game for each tutorial is not efficient at all if you wanna look back at multiple of your beginner scripts so folders or just disabling them is the better way

  • @pr0doxz410
    @pr0doxz410 ปีที่แล้ว

    Another W

  • @senrivity.official
    @senrivity.official 8 หลายเดือนก่อน

    so im working on a game and i want to make a door mechanic. i made a tween to fade the screen black, tp the player (isnt part of the tween) to another room, and then fade the screen back to normal. the problem is, whenever the player touches the door, it plays the tween multiple times and jitters a lot (due to the multiple parts of the character touching it, and with no waits in between). i dont know how to fix this and i was really hoping you could help?

    • @amara7734
      @amara7734 7 หลายเดือนก่อน

      look up debounce on the documentation

    • @senrivity.official
      @senrivity.official 7 หลายเดือนก่อน

      @@amara7734 I fixed ot already

  • @gametime9028
    @gametime9028 ปีที่แล้ว

    can you make a video where you code a gun?

  • @Nam-l3s
    @Nam-l3s 5 หลายเดือนก่อน

    Hey, How do you learn script and When will we end Advanced Scripting Tutorial ?

    • @HAPPYCHRIS_
      @HAPPYCHRIS_ หลายเดือนก่อน

      Just watch another tutorial

  • @abdalrahamnabbasi
    @abdalrahamnabbasi 7 หลายเดือนก่อน

    I'm trying to move a model with tween Service but I couldn't, I tried making it a child of a part and move the part instead but for some reason they don't follow their parent

    • @ChingChongRiceLover
      @ChingChongRiceLover 3 หลายเดือนก่อน

      try welding the parts together. use rig editor lite to do it and then try after that idk

    • @BernardoVeloso-123
      @BernardoVeloso-123 10 วันที่ผ่านมา

      use collection service

  • @domakrsnah1612
    @domakrsnah1612 11 วันที่ผ่านมา

    bro my part is just teleporting not going

  • @daminquet12
    @daminquet12 หลายเดือนก่อน

    how do you do tween service on gui though?

    • @BernardoVeloso-123
      @BernardoVeloso-123 10 วันที่ผ่านมา

      just change vector3 for udim2 and color for backgroundcolor3

  • @JohnPaul-v2f
    @JohnPaul-v2f 3 หลายเดือนก่อน

    0:07

  • @Sky_Blue_Crew
    @Sky_Blue_Crew 5 หลายเดือนก่อน

    How do you tween with CFrame

  • @Proxypp
    @Proxypp 7 หลายเดือนก่อน

    can you make a living making roblox games in monetary terms

  • @SamiulAlam-ql4yz
    @SamiulAlam-ql4yz 3 หลายเดือนก่อน

    im a 11 years old boy learning scripting :)

    • @jzmil1
      @jzmil1 หลายเดือนก่อน

      hows it going

    • @BernardoVeloso-123
      @BernardoVeloso-123 10 วันที่ผ่านมา

      nice to meet u im 1 year younger

  • @Anzeljaeg
    @Anzeljaeg 8 หลายเดือนก่อน

    Nice

  • @domakrsnah1612
    @domakrsnah1612 11 วันที่ผ่านมา

    nvm it works

  • @no_kurisu_allowed
    @no_kurisu_allowed 21 ชั่วโมงที่ผ่านมา

    twins service

  • @mrbanjoooo
    @mrbanjoooo หลายเดือนก่อน +1

    local TweenService = game:GetService("TweenService")
    local part = script.Parent
    local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)
    part.Anchored = true
    while true do
    local goal = {
    Size = Vector3.new(math.random(1,15), math.random(1,15), math.random(1,15)),
    Position = Vector3.new(math.random(1,50), math.random(1,50), math.random(1,50)),
    Orientation = Vector3.new(math.random(1,180), math.random(1,180), math.random(1,180)),
    Color = Color3.fromRGB(math.random(1,255), math.random(1,255), math.random(1,255))
    }


    local tween = TweenService:Create(part, tweenInfo, goal)
    tween:Play()
    tween.Completed:Wait()
    end

    • @BernardoVeloso-123
      @BernardoVeloso-123 10 วันที่ผ่านมา

      bro i loved this tween, totally random

  • @danielmatos9082
    @danielmatos9082 17 วันที่ผ่านมา

    I LOVED this topic, tysm for this tutorial. I just made this funny code btw
    local TweenService = game:GetService("TweenService")
    local part = script.Parent
    local tweeninfo = TweenInfo.new(3, Enum.EasingStyle.Elastic, Enum.EasingDirection.InOut, 5, true, 1)
    local goal = {
    Position = Vector3.new(23.792, 1.849, 31.068),
    Size = Vector3.new(20,20,20),
    Orientation = Vector3.new(0, 360, 0),
    Color = Color3.fromRGB(85, 255, 255),
    }
    local tween = TweenService:Create(part, tweeninfo, goal)
    tween:Play()