Hey scriptinghelpers, sorry to bother you all with a question. I've been looking at tutorials and other questions but I just don't understand really. I don't know anything about this but, It seems to me there's a lot of different ways to accomplish this I suppose. Basically I'm trying to move a parts position while making it look natural and smooth. Below you will find the current code I'm using which is a Vector3.new, and it's like right in your face fast. Doesn't really pop like I want I want too. Basically I want it to float up nice and smooth and I'm not sure how to accomplish that without changing the vector for every single stud.
This is a script inside of a part.
The script I ended up with that works!
local tweenservice = game:GetService("TweenService") local leviathan = script.Parent.Position local tweeninfo = TweenInfo.new( 30, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, true, 0 ) local posend = Vector3.new(44,0,-116) local tween = tweenservice:Create(game.Workspace.Leviathan, tweeninfo, {Position = posend}) game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) if message == "TEH EPIK DUCK IS COMING!!!" then tween:Play() end end) end)
I appreciate the help in advance, I'm only here to learn! Thanks again.
Hello! If you want to accomplish a smooth positional change you will have to use TweenService it works on parts too!-- not just GUIs. Or you could use repeat to move the part's vector. Here's what the Tweening method would look like!
local TweenService = game:GetService("TweenService") local tweenPart = script.Parent.Position local startPos = Vector3.new(44,0,-96) local endPos = Vector3.new(44,-100,-96) local tweenInfo = TweenInfo.new(60, -- time the tween takes Enum.EasingStyle.Quad, --kind of tweeting effect Enum.EasingDirection.InOut) -- type doesn't really matter local tween = TweenService:Create(tweenPart, tweenInfo, endPos} Tween:Play()
If the script doesn't function or contains a bug a comment is all that is required-- I have not tested this in studio.