I can make it bounce back and forth around the Y value I want it to stay at, but I don't want that. I want it to go to that Y value and then stay there. I also don't want it to increment in the way that it is incrementing right now. If there is no anchored brick below it, it will slowly begin swinging between more and more extreme Y values, eventually falling all the way down to the deletion zone and disappearing.
Problems:
- Bounces back and forth around the Y value I want it to stay at
- One bounce's amplitude slowly becomes larger
Code that I have managed to create:
yvel = script.Parent:getMass()*196
while wait() do
script.Parent.BodyForce.Force = Vector3.new(0,yvel,0)
ypos = script.Parent.CFrame.Y
if ypos > 30 then
yvel = script.Parent:getMass()*(196-math.abs(ypos)*.2)
end
if ypos < 30 then
yvel = script.Parent:getMass()*(196+math.abs(ypos)*.2)
end
if ypos == 30 then
yvel = script.Parent:getMass()*196
end
end
Any input would be appreciated :p

2 comments
Is this like a challenge you're doing? Why not use BodyPosition, or some easier method?
@wfvj014 Because I don't have any experience with body movers and thought that BodyPosition changed the position of the brick instantaneously. If it doesn't, then I'll use it or something. I'll have to look it up on the wiki but I probably won't understand a word that it says; I never do.