I need to script a wrecking ball for a map built by my friend.
The rope moves but the wrecking ball and the spikes don’t move with it. The rope is anchored. The ball and spikes aren’t anchored but they are welded to the rope so they should move with the rope.
Here is my code (it’s in a script parented to the rope part which is named “MainPart”):
local TweenService = game:GetService("TweenService")
local mainPart = script.Parent
local goal1 = {}
goal1.Position = Vector3.new(147.735, 61.239, 78.72)
goal1.Orientation = Vector3.new(0, 90, -70)
local goal2 = {}
goal2.Position = Vector3.new(147.735, 61.255, 97.636)
goal2.Orientation = Vector3.new(0, 90, -115)
local tweenInfo = TweenInfo.new(2)
local tween
while true do
tween = TweenService:Create(mainPart, tweenInfo, goal1)
tween:Play()
tween.Completed:Wait()
tween = TweenService:Create(mainPart, tweenInfo, goal2)
tween:Play()
tween.Completed:Wait()
end
I have tried searching here on DevForum but I have found nothing that would help me.