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

This script causing a moving brick using Tweens doesn't work. Can someone fix this?

Asked by 4 years ago

I have this script here and I wanna know why the part flies away! Ive tried replacing with waitforchild() but that didnt work. Im trying to make a random meter that varies in value.

--Services
local TS = game:GetService("TweenService")
local RS = game:GetService("RunService")
local HS = game:GetService("HttpService")

--Definers
local part = script.Parent.SpawnTherm:WaitForChild("Moving")


while wait(4) do
    --Defining Tables and Table Editing
    local mathRandom = math.random(2.5, 4)
    local goal = Vector3.new(0.7, mathRandom, 0.05)
    local tweenInfo = TweenInfo.new(
        4,
        Enum.EasingStyle.Cubic,
        Enum.EasingDirection.Out,
        0,
        false,
        0
    )


    while wait(1) do
        part.Position = Vector3.new(part.Position.X, part.Position.Y, part.Position.X)
        wait(0.05)
    end

    local Tween = TS:Create(part, tweenInfo, {Size = goal})
    Tween:Play()
end
0
So are you trying to make the part move? Because you dont have to do that with tweening. MarcTheRubixQb 153 — 4y
0
@MarcTheRbuxQb im trying to make an offset so it doesnt go inside of the block above it reidlab 2 — 4y
0
is can collide on? MarcTheRubixQb 153 — 4y
0
no, can collide is off. its also anorched. reidlab 2 — 4y
View all comments (4 more)
0
well if can collide is off then it goes through things MarcTheRubixQb 153 — 4y
0
turned it on and its still causing problems, please help! reidlab 2 — 4y
0
is the part above can collide off? MarcTheRubixQb 153 — 4y
0
both gotta be can collide on MarcTheRubixQb 153 — 4y

Answer this question