Moving up and down platform works however it makes my character try to noclip anyway to fix this?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    To make it not do that in the video hence stable
  2. What is the issue? Include screenshots / videos if possible!
    This

    as you can see it tries to noclip my character
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I havent found any
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")

local part = script.Parent
local tweeninfo = TweenInfo.new(5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, -1,true)

local tween = TweenService:Create(part, tweeninfo, {
    CFrame = part.CFrame * CFrame.new(0,100 ,0)
})
tween:Play()

--On the script we go!
local lastPosition = part.Position

RunService.Stepped:Connect(function(_, deltaTime)
    local currentPosition = part.Position
    local deltaPosition = currentPosition - lastPosition

    local velocity = deltaPosition / deltaTime

    part.AssemblyLinearVelocity = velocity

    lastPosition = currentPosition
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

3 Likes

This is an engine limitation, and you can’t do much besides writing your own character replication (which is hard).

It’s fairly unnoticeable, anyway, and I doubt most players would care.

Dangit :frowning: thx anyway i didnt know about that what about using bodyforces or constraints could that work?

That could work, but you then run the risk of Roblox physics dying. It shouldn’t be too much of a worry, but it’s something to keep in mind.

See PrismaticConstraint.

wdym of them dying? i dont understand

Are you running this script on the server or client :thinking:

(Is it a local script or server script)

server script not the local script why does that matter? whats the point of a local script if its just for you and not just everybody?

Try pushing the script into a local script (make sure the local script is on the client side) and reference the part from there.

See if it is smoother. Also, if everybody has the local script, it won’t be only just for you. It should run for everybody. If you’re worried about sync issues, just use a value or remote events to handle syncing it.

Also, just avoid running tweens on the server, it can get pretty performance costly when the amount of moving parts increases :pensive:

hmmmmm ok ill try that idk what you mean by make sure the local script is on the client side

ohhhh yeah that happens the reason why im using tween is because i want to change the speed
well i used a different method it worked but the more i up the speed the more it moves higher and higher the way up and i hate that

Just referencing the fact that there are some who accidently or purposely put a local script into server script service. :pensive:

I don’t entirely understand but as long as the tween and script was properly made, glancing it I think its fine but 11:00 me would probably miss something.

Tweens should be done on the client in order to ensure that it is smooth for the player. I don’t think there is a real case for using tweens on the server side but correct me If I’m wrong of course.

1 Like

What do you mean by roblox physics dying?

Sometimes the physics solver can sort of go unstable, but it shouldn’t be a problem.

idk what you mean would it be like game breaking could you show me a example

It means that your part will suddenly fly off into nowhere.

This shouldn’t happen though and I doubt it will.

Ive had that happen to me before

Did you try setting the network owner?
use the function :SetNetworkOwner().
if you might have many players on it, try putting nil inside the (). so it will be :SetNetworkOwner(nil).

If you know that you will have only one player on the platform, you can get the player by the Touched event, and then doing:
:SetNetworkOwner(player). Please note that the player has to be the actual player, and not their character.

The part is anchored, so network ownership doesn’t matter.

Besides, unanchored parts’ management is already handled by the engine. The engine automatically hands ownership of an unanchored part to whoever is closest, or the server if nobody is close enough.

I just tested this. it doesn’t fully fix it, but in my opinion it looks smoother.

The part isn’t anchored. They are using AssemblyLinearVelocity to move it.