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!
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
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.
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 👻
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
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()
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 😅
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!
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
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!
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 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
@@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
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?
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
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
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()
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!
Thanks dude! Hope you stick around for future vids to come! :)
HELPPP WHY ARE YOUR TURTORIALS SOOO GOOD!!!! I ALMOST UNDERSTOOD EVERY SINGLE TOPIC U EXPLAINED IN 1ST TRY
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
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!
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.
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 👻
me too
BrawlDev >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>TheDevKing
0:09 my favourite part of the video
BRUHHH
do you actually learn scripting or are you just watching
@@الخلبوصة when I commented this I was learning but I don't anymore
oh ok
Now we only need 2D UI Tweening tutorial! :3
guess its the same, u just change vector3 for udim2
wow these vids are great!
To repeat it infinitely, you can set the repeatCount to -1 and it will replay infinitely.
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)
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
tweenService is great!
Thank you very much.
Your so funny 🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣😂😂😂😂😂😂😂😂😂😂
its a compliment.
diddy's second favorite function
You wild for that 😂
Wait so Tween Service is move, scale, rotate and color triggers from geometry dash? Cool.
I THOUGHT THE SAME THING
At 7:32 what plugin do you use to display how far you moved a part?
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
@@BrawlDevRBLX That clears up a lot, and I found it too thanks!
@@Bengoo_Where did u find it?
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)
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 😅
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!
@@BrawlDevRBLX I see
Thanks for telling me! ❤️
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
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
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!
instead of a while loop, you can put -1 in repeatCount and then true
This was very helpful
thank you
BIG HELP THX BIG BRO
i like your video
TYSMMM
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.
just disable the old scripts
@@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
@@coolkid7377 that is not a good way to organize your scripts
@@SantaPo what would you suggest
@@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
Another W
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?
look up debounce on the documentation
@@amara7734 I fixed ot already
can you make a video where you code a gun?
Hey, How do you learn script and When will we end Advanced Scripting Tutorial ?
Just watch another tutorial
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
try welding the parts together. use rig editor lite to do it and then try after that idk
use collection service
bro my part is just teleporting not going
how do you do tween service on gui though?
just change vector3 for udim2 and color for backgroundcolor3
0:07
How do you tween with CFrame
can you make a living making roblox games in monetary terms
im a 11 years old boy learning scripting :)
hows it going
nice to meet u im 1 year younger
Nice
nvm it works
twins service
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
bro i loved this tween, totally random
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()