A-chassis cannot use Twenservice

Hello! I will for the first time post.

  1. What do you want to achieve? Keep it simple and clear!
    I want to use Tween for the body parts of A-chassis.
    It is used for bus doors.

  2. What is the issue? Include screenshots / videos if possible!
    The door parts are installed on the body, they do not move at all.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    If installed in Misc, Anchor will come off and parts will fall.

<!>Works fine on Base.↓

This is the script that opens the door.

--open
local clickDetector = script.Parent.ClickDetector
local onsw = script.Parent
local ofsw = script.Parent.Parent.Off

--door
local d1 = script.Parent.Parent.Parent.door.door1
local d2 = script.Parent.Parent.Parent.door.door2
local Service = game:GetService("TweenService")
local info = TweenInfo.new(0.3)
local info2 = TweenInfo.new(2)

local d1posX = script.Parent.Parent.Parent.door.door1.Position.X
local d1posY = script.Parent.Parent.Parent.door.door1.Position.Y
local d1posZ = script.Parent.Parent.Parent.door.door1.Position.Z
local d2posX = script.Parent.Parent.Parent.door.door2.Position.X
local d2posY = script.Parent.Parent.Parent.door.door2.Position.Y
local d2posZ = script.Parent.Parent.Parent.door.door2.Position.Z
--

function onMouseClick()
	onsw.Transparency = 1.0
	ofsw.Transparency = 0.0
	
	--moving door
	local Change = {Position = Vector3.new(d1posX,d1posY,d1posZ+0.5)}
	local Tween = Service:Create(d1,info,Change)
	Tween:Play()
	local Change = {Position = Vector3.new(d2posX,d2posY,d2posZ+0.5)}
	local Tween = Service:Create(d2,info,Change)
	Tween:Play()
	wait(0.2)
	local Change = {Position = Vector3.new(d1posX+4,d1posY,d1posZ+0.5)}
	local Tween = Service:Create(d1,info2,Change)
	Tween:Play()
	local Change = {Position = Vector3.new(d2posX-4,d2posY,d2posZ+0.5)}
	local Tween = Service:Create(d2,info2,Change)
	Tween:Play()
	--
end

clickDetector.MouseClick:connect(onMouseClick)

I’m Japanese and I can’t speak English well. sorry.

2 Likes

Hi there! I was also thinking about using TweenService, but I was learning hinges. It’s animation is similar to TweenService, but it doesn’t clip through parts like TweenService.

This GIF / Video showcases me using HingeConstraints moving the doors. It can help you achieve what you’re trying to do with TweenService.

1 Like

Those tiny blocks are the motors that have the HingeConstraint inside. The doors are connected via attachments. You can WELD the tiny blocks to the Bus’s Body so it doesn’t directly attach to it. If you are going to Weld, please unanchor all the parts.

Tip: If your door has multiple parts, weld all of them to one main part and use that main part for the HingeConstraint.

I’m sorry that I don’t know Japanese to help you understand better, but I hope this helps!

For A-Chassis, you won’t need to weld anything. (Lucky You!) But yes, put the doors in Misc.

1 Like


Thank you so much!!

Since Meshes is used throughout, it is warned that it is heavy :confused:

1 Like

The higher the number of “AngularVelocity” is, the faster it is.
1 on AngularVelocity is slow, although 5 is pretty fast. :smile: :grin:

This can be found in the HingeConstraint.

1 Like