Methods of making PrismaticConstraints local?

Here is what I’m trying to achieve;

Versus what I’m currently getting;

I’m using Prismatic Constraints as a way of making Lifts within my game, but the current problem I’m facing is that when I’m doing a solo test; everthing works, but as soon as I jump on a server, the Prismatics are no longer moving.
I’m assuming this is simply due to the server controlling the Constraint, and thats fair enough. An easy fix is to find it in the explorer and clone it. That solves the problem immediately.
However, I can’t do that in the live game.
I’m currently messing with creating a local version of the lift’s prismatic, but none of them react.
I’m using the following code, with self.Object being predefined as the prismatic;

		local LiftClone ="PrismaticConstraint")
		LiftClone.Attachment0 = self.Object.Attachment0
		LiftClone.Attachment1 = self.Object.Attachment1
		LiftClone.LimitsEnabled = true
		LiftClone.ActuatorType = self.Object.ActuatorType
		LiftClone.UpperLimit = self.Object.UpperLimit
		LiftClone.LowerLimit = self.Object.LowerLimit
		LiftClone.MotorMaxAcceleration = self.Object.MotorMaxAcceleration
		LiftClone.MotorMaxForce = self.Object.MotorMaxForce
		LiftClone.Velocity = self.Object.Velocity
		LiftClone.Parent = self.Object.Parent

Is there something I’m missing here?

This should go in #development-support:scripting-support FYI.

Might it be related to physics ownership? Does not explain why the properties of the constraint aren’t replicating to clients though.

Post moved, although this is more trying to figure out why this concept isn’t working.

It might possibly, but I’m creating a unique Prismatic here. It works in two cases;

  • I use the Explorer to copy and paste the part being used by the prismatic (The object appears to be controlling it, this is an oversight on my part. But even a local Prismatic doesn’t affect anything). Through the logic system I have made, this breaks all links to this part.
  • I am playing in a test Server that has a player in it while also running the game in the studio window (Which I think is a bug, but not entirely sure what is causing it or even what it is.)

Okay, so it appears that the Object needs to be local, as opposed to just the Prismatic. I’ve managed to solve this by storing everything in a model in the replicated storage, and then emptying its contents into the workspace locally.
It’s still not a great method, but it works.

1 Like