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

Object still thinks there is another object in the way?

Asked by
acuaro 29
4 years ago

So I have a game where you need to move platforms in a certain arrangement to make a ball go to the end zone. But in the first level where you just move a platform out of the way so the ball can go through to the end, this happens...

https://vimeo.com/387852015

So yeah, here is the platform moving script (local script) if you need to see it

local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(2)
local tween1 = TweenService:Create(game.Workspace.Lvl1.moveXPart, tweenInfo, {Position = Vector3.new(-82.182, 22.31, -124.617)})
local tween2 = TweenService:Create(game.Workspace.Lvl1.moveXPart, tweenInfo, {Position = Vector3.new(-59.177, 22.31, -124.617)})
game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
    if inputObject.KeyCode == Enum.KeyCode.D then 
        tween1:Play()
    end 
    if inputObject.KeyCode == Enum.KeyCode.A then 
        tween2:Play()
    end 
    game.ReplicatedStorage.LevelComplete.Level1.OnClientEvent:Connect(function()
        script.Parent.Visible = false
        script.Parent.Parent.LevelComplete:TweenPosition(UDim2.new(0, -1,0, -36), 'Out', 'Quad', 2)
        wait(1)
        script.Disabled = true
    end)
end)



I tried messing around with the settings in the ball (Anchor, Weld, Cancollide) but nothing worked. Thanks if you could help!

0
And no, the ball isn't just hitting the corner (I've checked that) and there is no invisible wall. acuaro 29 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

The platform is actually still in the same spot as it started since you are moving the platform in a local script. Clients cannot make changes to the server unless you use a Remote Event or Remote Function.

1
Thank you so much! It worked flawlessly! acuaro 29 — 4y
Ad

Answer this question