#Move block with Gui

5 messages · Page 1 of 1 (latest)

carmine storm
#

I need help! I put an imagebutton that when a user clicks it the block connected to it moves to the right for 5 stunds, but when it encounters another block it passes through it as if it had no collisions, my goal is to make it move but when it encounters another block stops

#

i use this script in imagebutton:

#

local TweenService = game:GetService("TweenService")
local block = game.Workspace:WaitForChild("oppa")

local function moveRight()
local originalPosition = block.Position
local info = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)

local goal = {Position = originalPosition + Vector3.new(10, 0, 0)} 

local tween = TweenService:Create(block, info, goal)
tween:Play()

end

script.Parent.MouseButton1Click:Connect(moveRight)

#

---------------------- (oppa is the name of the block)

hollow maple