Part not Moving

Greetings, Developers!
Today I was trying to make a part keep moving constantly using BodyForce just like Tower of Hell:
robloxapp-20200928-2042557.wmv (5.6 MB)

Part Not Moving:
robloxapp-20200928-2025069.wmv (1.6 MB)

Code:

script.Parent.Touched:Connect(function()
while true do
script.Parent.BodyForce.Force = Vector3.new(-164.98, 0.5, -0.17)
wait(1)
script.Parent.BodyForce.Force = Vector3.new(-164.98, 0.5, -21.51)
end
end)

But sadly it didn’t work also the output did not gave any errors
(I’m a beginner so please no hate)

Workspace:
Workspace
Output:

2 Likes

Did you anchor the part you’re moving?

Firstly I recommend that you use body velocity to do that if you want it to keep moving. Because body force will move it only once.

Is it a Player Touched function? if so try this

script.Parent.Touched:Connect(function(hit)
local Players = game.Players:GetPlayerFromCharacter(hit.Parent)
if Players then
           while true do
script.Parent.BodyForce.Force = Vector3.new(-164.98, 0.5, -0.17)
wait(1)
script.Parent.BodyForce.Force = Vector3.new(-164.98, 0.5, -21.51)
          end
     end
end)

I tried but still dont work fwgweohgweiguewgwegwegwe

Okay I will try it DONT MIND THISSSSSS

Wait there is a TouchTransmitter (aka. Touch interest) in the part so the touched event wont fire. Tou need to delete that.

@FlamingGuards
Not working bro

No, it automatically spawned when I started the game.

Did you touch the part? if not do you want it to repeat even though you diddn’t touch it. If you havn’t been touching the part you should really touch the part.

Hmmmmmmmmmmmm. Then delete it with a script then? When the script starts do script.parent.touchineterest:Destroy()

Lemme send u guys a video of me touching a part

Without Touch:

while true do
script.Parent.BodyForce.Force = Vector3.new(-164.98, 0.5, -0.17)
wait(1)
script.Parent.BodyForce.Force = Vector3.new(-164.98, 0.5, -21.51)
 end

try now, I made a code mistake

This will work. The reson is that it doesnt work is there is a TouchTransmitter wich blocks the Touched event.

Bro it automatically spawns when i start the game

that will happen if you don’t want a touch to function it.

Then automatticaly delete it with a script every time the game starts.

I mean put this on the start of your script : script.Parent.TouchInterest:Destroy()

You doing it in a Server Script or Local Script?

Okay lemme check(dont mind this)