There are many problems that I have. When I tried out some solution, it only causes more problems or the solution isn't working which I fixed by reverting the change. Also, this problem happens both in the studio environment and in the live game.
==== Expected and Actual Result ====
Expected Result: The object will move to determine position and the player will stick to the object. The object will move at a constant speed without changing its speed due to acceleration or de-acceleration.
Actual Result: Object is sinking below determined vertical (Y) position, the object moves at a different speed, deaccelerating when closer to the determined position and accelerate very quickly when far away from determined position. The Player did stick to the object, however.
==== My attempt at finding solution ====
Solution Requirement:
Object must stop falling below determined vertical (Y) position. (This also applies to other position where it will create "Rubber-Band" effect)
Object must be moving and must stay at a constant speed. (object can never accelerate OR deaccelerate)
Player must be stick to the object (player must be moving along with object without any interaction)
There's no major complication with the script (Example: Object glitching when player stand on it)
1st Solution: Rising MaxForce of Y component. This would have been an easy solution and I would have never written this question BUT it looks like the object completely ignored the Y component and keep sinking regardless.
2nd Solution: Changing the D property of BodyPosition. If I change D lesser then the object will move too fast (still don't solve constant speed problem) which isn't what I wanted. When I look at the hour of code which is made by roblox (I know it's old, I am that desperate). It seems like they change the D property to be higher than the P property. I tried the same property, SAME SCRIPT but the result is different from the video. (which I am expecting)
3rd Solution: Using BodyVelocity. BodyVelocity solves constant speed but won't make the player stick to it. BodyVelocity is already out of the window at this point.
4th Solution: Freezing position of Y using script. This solves the problem of object sinking but this does not solve the constant speed problem. This solution also introduces a new problem which is when the object just glitched (weirdly moving, sometimes falling out of the world) when the player stands on it.
5th Solution: Manually set the position of the object using script. This removes all body mover but the player doesn't stick to the object AND it's also very laggy which is questionable, player sticking to an object can be solved by using a conveyor-based solution (object is anchored and player is moving when standing on) but very hard to predict and very weird. This solution is out of the window.
==== Code of the script ====
NOTE: There's no problem with the script itself, it just happens that the code doesn't solve any problem that I mentioned.
-- This is my current script (Server Script) local me = script.Parent local bodyPos = me.BodyPosition while true do bodyPos.Position = Vector3.new(-14.25, 0.6, 72) wait(7) bodyPos.Position = Vector3.new(-14.25, 0.6, 32) wait(7) -- The difference between each position is 40 (looking at Z component) end
==== Hierarchy of object ====
Also here's the hierarchy of my part that I want to move an object which is a big problem.
---- MovingPart <-- Part I want to move
-------- Script <-- See above to look at the code of the script
-------- BodyAngularVelocity <-- This is to stop the object from spinning
-------- BodyPosition
Use this tree to add an object OR remove object to the part included in the solution.