Cbrrah
(Cbrah)
November 23, 2021, 2:01am
#1
The script is working, the only problem is that when I start the game, my platform falls to the ground. It still moves back and forth but; it doesn’t stay in the correct place on the Y axis.
Script:
start = script.Parent.Parent.Start
finish = script.Parent.Parent.Finish
bodyposition = script.Parent.BodyPosition
while true do
bodyposition.Position = start.Position
wait(2)
bodyposition.Position = finish.Position
wait(2)
end
Thanks!
4 Likes
Mystxry12
(Mystxry)
November 23, 2021, 2:02am
#2
Set anchroing to tru. I think thts the issue
Cbrrah
(Cbrah)
November 23, 2021, 2:02am
#3
If I set it to true, it doesn’t move at all. That’s how BodyPosition works.
Cbrrah
(Cbrah)
November 23, 2021, 2:05am
#5
Would you mind elaborating? As far as I’m aware; you cant anchor a BodyPosition.
Make sure you’re putting enough force on the Y
axis.
Cbrrah
(Cbrah)
November 23, 2021, 2:12am
#7
I’m already did that. Thank you for the suggestion though!
Forummer
(Forummer)
November 23, 2021, 2:23am
#8
Have you tried enabling the Massless property of the part?
Cbrrah
(Cbrah)
November 23, 2021, 2:24am
#9
The part still falls down. I believe gravity still pulls down massless parts.
Forummer
(Forummer)
November 23, 2021, 2:25am
#10
Are start and finish correctly anchored?
Cbrrah
(Cbrah)
November 23, 2021, 2:25am
#11
yes, Start and Finish are anchored and canCollide == false
Forummer
(Forummer)
November 23, 2021, 2:28am
#12
start = script.Parent.Parent.Start
finish = script.Parent.Parent.Finish
bodyposition = script.Parent.BodyPosition
local bv = Instance.new("BodyVelocity")
bv.Velocity = Vector3.new(0, 0, 0)
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bv.P = 9000
bv.Parent = script.Parent
while true do
bodyposition.Position = start.Position
wait(2)
bodyposition.Position = finish.Position
wait(2)
end
Change the “9000” value if necessary.
Cbrrah
(Cbrah)
November 23, 2021, 2:30am
#13
The part is no longer moving when using that script. I’m not sure why.
Forummer
(Forummer)
November 23, 2021, 2:35am
#14
start = script.Parent.Parent.Start
finish = script.Parent.Parent.Finish
bodyposition = script.Parent.BodyPosition
local toggle = false
bodyposition.ReachedTarget:Connect(function()
if not toggle then
bodyposition.Position = finish.Position
toggle = true
elseif toggle then
bodyposition.Position = start.Position
toggle = false
end
end)
bodyposition.Position = start.Position
You may want to re-add the waits.
Cbrrah
(Cbrah)
November 23, 2021, 2:40am
#15
Now the script stops shortly after it starts. (And it still falls)
Edit: If you’re aware of another way to move the part please let me know.