Wall going sideways

Let me get straight into the problem, im trying to make it so a wall comes out of the ground it works but it goes sideways and not straight
Here:
wall is sideways

Code:

                    local offsetCFrame = CFrame.new(0, TweenMoveDistance * wallState, 0)
					local newCFrame = MainPart.CFrame:ToWorldSpace(offsetCFrame)

				--Play tween--
					local tween = TweenService:Create(MainPart, TweenInfo, {CFrame = newCFrame})
					tween:Play()

Thanks so much!!

Edit: tried putting:

0, 0, TweenMoveDistance * wallState

To the other zeroes but didnt work, it just didnt show up… i also tried the other one but the middle one is the only one that worked unfortunately…

I forgot to put this in but here is the variables:

local TweenMoveDistance = 7
local wallState = 1

Hello again!
Tell me if this code works :slight_smile:

local MainPart = script.Parent --YourPart
local TweenService = game:GetService("TweenService")

local TweenMoveDistance = 7 --7
local wallState = 1

local buttonTweenInfo = TweenInfo.new(
	4,  -- Time
	Enum.EasingStyle.Quad,  -- EasingStyle
	Enum.EasingDirection.Out  -- EasingDirection
)



local offsetCFrame = CFrame.new(0, TweenMoveDistance * wallState, 0)
local newCFrame = MainPart.CFrame:ToWorldSpace(offsetCFrame)


local tween = TweenService:Create(MainPart, buttonTweenInfo, {CFrame = newCFrame})
tween:Play()
1 Like

Sure will when i get to my computer, kinda out of town rn so sorry about that!!

Forgot to say this but, i could just change the orientation before tweening…