Moving button

Is there any way to make the button move?
I don’t mean when touch button and object moved
But is there a script that make button moving?

Buttons are made of Light, Plate, and Hitbox. Make sure to move them individually with moveWater function.

ok

1 Like

No you

also you can’t reference a button
i tried to do it

What can’t reference

buttons
i tried to do
Lib.Map._Button1.Light.BrickColor = BrickColor.new("Lime green")
it said “_Button1 is not a valid member of Model”

Do workpace:FindFirstChild("_Button1",true)

michael moment

It’s because the button it’s a model, try to do it in another way.

i referenced the button model’s child, Light, which is inside the model

1 Like

Okay…

Do one thing, unanchor the button,except one part of it, attach all parts of the button using weld, and then use the move script on the anchored part, lemme know if it works cuz I am guessing.

Thanks, I will try that if it’s works

for _,f in pairs(script.Parent["_Button1"]:GetDescendants()) do
if f:IsA("BasePart") or f:IsA("UnionOperation") then
--moveWater script here but part is f
end
end

Guys! The button has a name random, so means if you use “_Button1”, don’t will works.

1 Like

i found that out when making a map, so you’ll have to implement an system to find buttons

this should work. make sure you have weld constraints inside of the button parts to the platformPart

(there are two ways. either one should work)

1st way

local TweenService = game:GetService("TweenService")

local platformPart = Lib.Map.Geometry.platformPart
local areaPart1 = Lib.Map.Geometry.areaPart1
local areaPart2 = Lib.Map.Geometry.areaPart2

local tweenInfo = TweenInfo.new(
    2,
    Enum.EasingStyle.Linear, --Put your EasingStyle here
    Enum.EasingDirection.Out, --I suggest using out cuz it looks better
    -1, --Repeat counts, -1 is infinite
    false, --Tween reverses after tween is finished
    0 --Delay time
)

local properties1 = {
Position = areaPart1.Position
}

local properties2 = {
Position = areaPart2.Position
}

local Tween1 = TweenService:Create(platformPart, tweenInfo, properties1)
local Tween2 = TweenService:Create(platformPart, tweenInfo, properties2)

while true do
    tween1:Play()
    wait(2)
    tween2:Play()
    wait(2)
end

2nd way

while true do
    Lib.Script.moveWater(Lib.Map.Intro._Platform#, Vector3.new(15, 0, 0), 2, true) --Remove the pound with the number you want (any works)
    wait(2)
    Lib.Script.moveWater(Lib.Map.Intro_Platform#, Vector3.new(-15, 0, 0), 2, true)
    wait(2)
end

or for btnFunction

btnFunction[#] = function() --Remove the pound with the button number you want
    while true do
       Lib.Script.moveWater(Lib.Map.Intro._Platform#, Vector3.new(15, 0, 0), 2, true) --Remove the pound with the number you want (any works)
       wait(2)
       Lib.Script.moveWater(Lib.Map.Intro_Platform#, Vector3.new(-15, 0, 0), 2, true)
       wait(2)
    end
end

this should work

1 Like

also have the platformPart CanCollide false and transparency to 1

There’s a super-easy way to find buttons. Just make use of ObjectValues.

1 Like