How do you use a Prismatic Constraint?

Context:
I am trying to use a prismatic constraint to move a wall with a hole in it so that the player can jump though. I am using a prismatic constraint because the player has a force on their body and if I used something like a linear force the wall would get pushed back or slowed down.

Help:
I’ve been trying to understand how to use it, but the creation docs don’t tell me enough. The main things I want to figure out is how do I choose which part is going to move, and do you even need to use two parts to make one of them move.

If you have more information other than the above I would be happy to learn it, Thanks!

1 Like

PrismaticConstraints work like this, (Im not the best at explaining), think of it as a cable car line, except that it is straight. The line connects 2 points. That is the wall and another part which is anchored somewhere else, securing the line. The wall will only slide on 1 axis on that line and It wont rotate.

A prismaticConstraint does not move the wall, It only makes sure that the wall is able to slide on 1 axis and make sure it cant rotate. If you do not want the player to be able to slow down the wall, I advise using a bodyVelocity and then setting the BodyVelocities MaxForce to math.huge.

BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)

After that, make the walls density as high as it can go in properties. I hope this helped!

2 Likes

Try searching the forum posts as well. There are a few good posts about PrismaticConstraints.

Here’s a platform model that explains a lot about how they are set up, and a simple way to script them.

Remember that you have to increase your Force to make the constraint move, as well as make it a motor or servo controlled movement.

Even though you solved my question, I have to ask, do you think that the fact that my player moves forward using CFrames could be the reason the wall is getting pushed back? Because I was thinking maybe because its not using forces, then the wall can’t register that its force is being countered.

1 Like

Your wall needs to have a higher mass (im guessing its thin) in order that it doesn’t get pushed back… so increase that through the Custom Physical Properties. Then you will also need to adjust your constraint forces, unless those are at max already

2 Likes

What kind of forces are you using to move the Player? If the forces are very high then try lowering them just enough to have the player move properly, but not high enough to push other objects around easily.

@Chimmy_Coder “A prismaticConstraint does not move the wall” isn’t a true statement. PrismaticConstraints can move along their length when the ActuatorType is set to Motor or Servo.

Both of you should take a look at the PlatformModel link I included before to see what I mean.

Ah, yes, sorry for the error. I forgot about the other acutors types

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.