Hello,
So I’m in a super stressful situation where I have no idea how all of a sudden my tween started to move in the wrong direction when it was literally working just fine. All I’m really doing is just making a jump scare where as you’re walking through this one entrance, you touch an invisible trigger making a ball fly across the room slamming onto the wall near you.
This is how the ball is meant to move:
Simple, nothing complicated at all until now.
The code inside the trigger which makes this supposed jump scare happen:
local trigger = script.Parent
local train = game.Workspace.wallstrain
local trainsound = game.Workspace.wallstrain.trainrunning
local TweenService = game:GetService("TweenService")
local girllaughter = game.Workspace.girllaughter
local tween = TweenService:Create(train, TweenInfo.new(1.8, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {CFrame = train.CFrame * CFrame.new(58.5,0,0)})
local trainhit = game.Workspace.trainbreaksound.cliphit
local force = game.Workspace.force
local Debounce = false
trigger.Touched:Connect(function(hit)
if not Debounce then
if hit.Parent:FindFirstChild("Humanoid") then
tween:Play()
force:Play()
wait(0.03)
trainhit:Play()
Debounce = true
wait(0.05)
trainsound:Play()
Debounce = true
wait(1.2)
girllaughter:Play()
trainsound.Volume = 0.8
wait(2)
trainsound.Volume = 0.6
wait(0.2)
trainsound.Volume = 0.4
wait(0.2)
trainsound.Volume = 0.2
wait(0.2)
trainsound.Volume = 0
wait(2)
force:Stop()
script:Destroy()
end
end
end)
This is what the movement somehow changed to now:
It’s going the right direction but then disorients itself up while doing so???
I’ve already tried looking up this problem of tweens somehow going the wrong way but none were useful to me. I had tried messing around with the directions the tween would go but would still disorient. I’d appreciate any help as this issue is really irritating me now knowing how easy it is to get to work but is failing me. Could it be the angle things are at and I have it calculated incorrectly or something?