Why is my pushing platform so slow and why does it not shoot back when a player isn't touching it?

I am making a pushing platform that should move fast when a player is pushing, and when a player stops pushing, it flings back. These are the contents of the pushing platform.

Contents of push platform:
image

As you can see, the pushing platform uses constraints, attachments, and vector force.

The pushing platform does work, but when you push it, it moves very slowly. Also, when a player stops pushing it, it doesn’t fling back automatically.

Here is an example video:
https://gyazo.com/c68a6cfb792578a28cc74cf5390c13d5

If you do know what the issue is then please reply!

Hiwiwi again!

I thought u were making a platform moving on Y axis. Would be better if you showed this video on the last post where I replied to you.

Well, what are u using on script? And how do u use the VectorForce?
What u mean by moves very slowly?

If you are not using scripts it will be “impossible” to return automatically

1 Like

Oops hehe yea sorry! Ok so the VectorForce is used to return the platform to the start. And by moves very slowly I mean when the player is pushing the platform, the platform doesn’t go straight to the finish really fast, but instead moves very slowly as demonstrated in the video.

Well I think, the VectorForce is acting against the Player’s force, so maybe that causes the platform to move slower than if it doesnt contain the vectorForce.

Think that the platform have certain Density, the player is fighting against the gravity to push thet object with mass over the space, plus, if the VectorForce is applying force to push back, then the player is fighting against the mass and the force.

I would remove the VectorForce and manage the movement by scripting. If you change ur Prismatic behaviour to Servo, you will have TargetPosition, that can be accesed by script and make it go back to the original position when the platform reach certain distance from the initial position

2 Likes

If you set the ActuatorType of ur Prismatic to Servo.
You will be able to set the TargetPosition, Speed etc.

image

Then you can change the values Dinamically by scripting (script intended to be placed inside a model containing 2 parts, “pistonHold” is the root part of the constraint and “piston” is the name of the Prismatic Constraint inside “pistonHold”):

local pistonMotor = script.Parent.pistonHold.piston

while true do
	if pistonMotor.CurrentPosition < 6 then
		pistonMotor.TargetPosition = 60
	end
	
	if pistonMotor.CurrentPosition > 58 then
		pistonMotor.TargetPosition = 5
	end
	
wait(2)	
end

This is just a back and forth

1 Like

Hmm but still, wont this just make it go back and forth instead of making the player do all of the work? My goal is for the player to push the platform, and when he/she stops the platform shoots back.

Yup well, I just gave u a quick example on how to achieve it…

You should add in the script, some statements to check the player, to set the values, the behaviour, the times, etc. Implement mechanics into ur system

I would be happy to help you, thats why the forum is here, isnt?

2 Likes

Hey! Well Im still learning so I wanted to test that BasePart.Touched() event I was talking with you (never tried it before :v)
So I made some tests, is this somehow similar to what u are trying to make?
It’s a little glitchy cause, this should be made on clientSide and I just went ServerSide (recording its very cheap too but yeah! xD)

example.wmv (4.7 MB)

I made a very basic script, tell me if u wanna try it :3

1 Like

Oh yes! I would very much like to try it! That is exactly what I want. :smiley:

Sorry for the late reply.
Im sending u a cap, I hope its not messy. Just dont forget to name the Prismatic and parts the same way that in the image.
Holder, MovePlate, and PrismServo are the important ones. And the script should be placed as children of the main model container.

The script is a little glitchy cause its just an example, in order to make it work better, you should modify it for a LocalScript and calling RemoteEvents, maybe using HeartBeat, etc.

local prismServo = script.Parent.Holder.PrismServo
local movingPlate = script.Parent.MovePlat

local PlatformLock = false -- basic lock
local HRP -- HRP of the player standing on platform

local function doLoop()
	while PlatformLock do -- Loop with lock, if a player already touched the part
		local distance = (HRP.Position - movingPlate.Position).Magnitude -- Measure distance player - part
		if distance > 5 then -- If player left platform
			PlatformLock = false -- unlock the platfrom
			prismServo.ActuatorType = 2 -- set Servo again
			prismServo.TargetPosition = 1 -- Position near the base holder
		end
		wait(1)	-- Checking Proximity each 1 second
	end
end

local function plateStand(playerPart) -- On touched part function
	if PlatformLock then -- if part has been already touched
	
	else -- if part is first time touched
		local player = playerPart.Parent -- who touched
		HRP = player:FindFirstChild("HumanoidRootPart")
		--print(HRP)
		if HRP == nil then
		else
			PlatformLock = true -- unlock the updating loop to check distance
			prismServo.ActuatorType = 0 -- prismatic actuator to Default (to move part on normal push)
			doLoop() -- call the loop
		end
	end
end
movingPlate.Touched:Connect(plateStand) -- on touched part event call plateStand()
2 Likes

Intenta Revisar la version De Tu app Puede ser eso.