Prismatic constraint only working when touching parts

I am attempting to make an elevator using a prismatic constraint. It works as expected in Run mode:
https://gyazo.com/90438af47bc41558df19d4814b31a260

However in Play mode it only works sometimes while the player is inside the elevator. Upon the player exiting the elevator it goes back down. (This is not scripted)

The script is very simple. It simply sets the target position of the prismatic constraint.

How do I make it work even without a player inside the elevator? Why is it doing this?

Do you ever set the network owner of the root part of the elevator to the server? You may be experiencing discrepancies when owners change, causing this behaviour. It’s worth attempting.

2 Likes

I believe this has fixed it, thank you!

Though, it may have had something to do with the fact I was calling the function to move the elevator from the client. Just to be safe, I’ve kept the network ownership changing.

If the client is the one setting the constraint’s properties, then network ownership changing would definitely present some kind of issue. In this case it would be best to either shift the elevator fully client-sided or put the server in charge of moving the elevator around. The former is preferred for the smoothest experiences.

The server is completely responsible for moving the elevator, I was just running the function from the command bar which I think will run code from whatever the current view is (client / server) and I was running it on the client

Ah, alright. That would definitely do it in. Always be sure to check what view you’re on just in case! :slightly_smiling_face:

1 Like