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: 1) Bounces back and forth around the Y value I want it to stay at 2) 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