Pillars won't go down

Try this instead:

leftGoalOpen.Position += (leftGoalOpen.CFrame.UpVector() * 3)

You cant assign anything to those vector classes as they’re readonly.
Also, I strongly suggest to read through CFrames.

This link will take you to a more complicated site with the vector values detailed:
CFrame

I put it like this : https://gyazo.com/30d22199a34c0f3021dba82a3598c698

And I tried how I did mine before with changing the X one and I realised when the part doesn’t have anything in it, it will work but if it does it won’t.

Oh nothing it was smaller pieces that goes down and bigger pieces don’t.

Oh geez, this thread really faced reply bloat. This is why developers shouldn’t treat the forum like a real time chat channel and should reply instead with more hearty posts that have a higher chance of functioning. This could’ve been resolved a lot quicker in my opinion.

In any case, you should be fine to just use a model tweening method here. I do believe someone linked my tutorial earlier which is why I’ve dropped by. If your goal is to move pillars up and down then you will be aiming to work along the Y axis, not the X.

I created a reply a bit down which shows you how you can tween your model instead using the new pivot APIs, so it may be worth taking a look into:

1 Like

Thanks I will start reading it

I tried the Y and the same error, I even tried X and the same error.

Like even with Y and X they go left

And now the pillar is moving rapidly and the top one isn’t moving an inch

This isn’t sufficient enough information for me to offer you help based on what you have now. Please include more detailed information regarding what you’re experiencing, the exact error and what you’re trying right now. Media would also be helpful to see what exactly is happening.

1 Like

https://gyazo.com/acd6af6ec4bcf1db23b478450fb98259

There you should have everything.

If you don’t have enough information of this subject just ask me and I shall provide.

Thanks for the GIF. Protip on forum use in the future: please try to condense posts into one. You can edit extra short thoughts into previous posts so that you don’t have a train of bump posts but instead one large connected train of thought. This isn’t a real time chat room, so aim to condense posts.

So, in any case, I decided to spend a bit of time creating a repro file for this that integrates my own code, sans a few changes and it seems I’m getting the effect that you’re looking for. Super important to try and play around with solutions you’re given or are made available as much as possible.

Check out my attempt here:

I applied essentially the same code I linked you but with a few changes of my own as well as its own build. In general it seems you aren’t aware of the direction of your parts. It’s relatively important to know the axis of your parts so you can determine how exactly you want them to move. If translating parts by their Y axis doesn’t move it vertically then the orientation is off.

Repro code:

local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")

local Pillar = script.Parent
local ProximityPrompt = Pillar.Top.ProximityAttachment.ProximityPrompt

local DefaultTweenInfo = TweenInfo.new(1)

-- Realistically, the offset CFrame would be calculated by a reference part instead
local RaisedPosition = Pillar:GetPivot()
local DownPosition = RaisedPosition * CFrame.new(0, -Pillar.PrimaryPart.Size.Y - 0.1, 0)

local isDown = false
local isActive = false

local function tweenModel(model, tweenInfo, targetCFrame)
	local steppedConnection

	local CFrameValue = Instance.new("CFrameValue")
	CFrameValue.Value = model:GetPivot()

	steppedConnection = RunService.Stepped:Connect(function ()
		model:PivotTo(CFrameValue.Value)
	end)

	local tween = TweenService:Create(CFrameValue, tweenInfo, {Value = targetCFrame})
	tween.Completed:Connect(function ()
		steppedConnection:Disconnect()
		CFrameValue:Destroy()
		task.defer(tween.Destroy, tween)
	end)
	tween:Play()
	
	return tween
end

ProximityPrompt.Triggered:Connect(function (player)
	if isActive then return end
	
	isActive = true
	isDown = not isDown
	
	ProximityPrompt.ActionText = isDown and "Raise" or "Lower"
	
	local tween = tweenModel(Pillar, DefaultTweenInfo, isDown and DownPosition or RaisedPosition)
	tween.Completed:Connect(function ()
		isActive = false
	end)
end)

Repro file:

PillarMoveRepro.rbxl (31.5 KB)

I encourage you to use the above items as learning resources. I don’t encourage using them as-is in your project or trying to modify the file to fit your needs; you should instead be checking how I do things and then making an attempt to fix your own setup.

3 Likes

Right now I am trying it and sorry for doing bumps

So I tried it and it worked, but with my model it won’t work. If you can I linked my model here down below and put the script in, because I tried and nothing is coming up.

PillarMoveRepro.rbxl (45.0 KB)

Worked for me.

I just ported over the elements and used the Union instead of the PrimaryPart as my point of reference for how much the pillar should move down by. Hopefully you also debugged your code when you made your attempt and did a few tweaks first!

PillarMoveReproNewModel.rbxl (44.8 KB)

1 Like

I can’t thank you enough but sadly I have another issue and you are so good at scripting which is why I would personally ask you for this task. The task is that a button (not press e gui) in a booth would active 4 from the front and 4 from the back. There would be another button where all 12 pillars would go down. If you don’t want to do it it is fine as you already done the previous task and I can’t thank you enough.

TweenModel is a nice utility function so you could use a for loop to run it across all your pillars at one time. If you need any kind of synchronisation then that’d be up to you to build in, but it’d really be as simple as linking several model pivots to the CFrameValue dummy object instead of just one.

I’m not thinking of this in terms of a task but rather as helping and building off of the attempts you’ve already made. Extending this code to make larger systems is up to you to do. Remember to reference the Developer Hub and some tutorials along the way so you can improve your coding and learn how to apply this as you go. Remember to problem solve: break down your problem then look for things relevant towards accomplishing each part of that break down.

1 Like

If I pay for a service of scripting would you do it?

No. I do not make myself available for hire and I have a job, just that because it happens to be with Roblox I’m also available throughout the day and have been on the DevForum for a bit.

Anything else unrelated to the issue in the OP can be PMed to me or started in a new thread. Should try and keep the thread on topic with resolving the issue. :slight_smile:

Ok, worth a try tough, and again thanks:)