How do you make a constraint part fling back once a player stops pushing it?

Hello! I am trying to create a part that when a player pushes it, the part moves to the finished. I did this by using prismatic constraints. How would you make it so that after there is nothing on the part, it goes back to the starting position?

Sorry if this is very confusing…

You mean:

A player is able to push a part (a part with prismatic) The player pushes the part from the starting point, all the way to the end (the end is the another constrained part? or Limits on the prismatic?)

Then… if a player isn’t ON the block (riding it?) the block returns to the starting point?

Or what u mean by “after there is nothing on the part”?

What is this? somekind of pushing piston? a train?

Well I am making a game kind of like JTOH, and I want to replicate the pushing block so yes I want it to be pushed all the way to then end and I want it to return to the starting point if a player is not on it.

I dont know the JTOH game :v
So we are talking about a Part that moves on Y axis when a player is standing on the part, it goes down and remains down until the player left the part, then the part goes up again?
Scripting method:
On BasePart.Touched by the player, set the TargetPosition of the constraint to 0. While standing on the part, use a HeartBeat or simple loop to constantly check if player still standing on the part, once the player left the part, change the TargetPosition again to the original value or any new desired value.

Or maybe, try to do it by using springs with the Prismatic attachments, (I wont use this physics method due to unepected behaviour)

1 Like