Parking garage boom tweening

Hey scripters,

I’m currently making my first attempt at scripting using OOP so don’t judge any dodgy work there. I am making a boom system for a project I’m making and I can’t figure out for the life of me how to create a tween to lift the boom. Ignore the small part below it, that will be used for ray casting later, for now there is just a click detector inside of it for testing.

Boom down

Boom up

How can I tween the boom down object to rotate 75 degrees with the pivot point being at the base on the left? Here is my current tween:

local tweenService = game:GetService("TweenService")

local boom = {}
local metaTable = {}

function boom.open(animTime, boomPart, openBoom)
	local self = {}
	setmetatable(self, metaTable)
	
	local animationInfo = TweenInfo.new(animTime, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0)
	local openAnimation = tweenService:Create(boomPart, animationInfo, {
		CFrame = ????
	})
	
	openAnimation:Play()
	
	return self
end

return boom

Any help or feedback would be greatly appreciated!

Thanks!

CFrame = boomPart.CFrame * CFrame.Angles(math.rad(75), 0, 0)

like this?

Yes but that rotates the part from the centre of the part rather then rotating it from the post on the left

Go to this part, and go to pivot, change whichever axis the object is along to a value. Try -5 and +5 then try to find where the best pivot is. This will show when you are holding the object with the move tool.

While true when using the rotate and move tool, the script ignores the pivot point

@Primbreak3r

I figure it out! I feel dumb. If anyone was having a similar problem, weld the motor and the boom together with part0 being the motor (see image below)

After this, just make the tween rotate the motor like in the code below:

local animationInfo = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local openAnimation = tweenService:Create(motorPart, animationInfo, {
	CFrame = motorPart.CFrame * CFrame.Angles(math.rad(75), 0, 0)
})
	
openAnimation:Play()
2 Likes

Thanks for the help but I was already typing my solution before you posted this. I appreciate your time and help!