So here’s the script:
game:GetService("TweenService"):Create(workspace.ofdoor, TweenInfo.new(1, Enum.EasingStyle.Quad), {CFrame = workspace.ofdoor.Hinge.CFrame * CFrame.Angles(0,math.rad(97.89),0)}):Play()
I want to make door animation. The script is server side. So are the script wrong or something else?
1 Like
Hello there. Are you attempting to tween a model or a part?
1 Like
veilict
(MNSD_Vel)
#3
If this is a model, make sure you use PrimaryPart instead of treating the model as a BasePart.
This does mean you have to weld every part of the door to the primary part in order to achieve the desired effect.
Thank you!
1 Like
I want to animate a part not a model.
1 Like
The Hinge
already I set to a PrimaryPart
.
1 Like
veilict
(MNSD_Vel)
#6
What is the class for workspace.ofdoor
?
1 Like
The class of that model is a Group
veilict
(MNSD_Vel)
#8
What? There is no class named Group
.
Click on workspace.ofdoor
in Explorer and look inside the Properties pane and tell me what ClassName reads.
2 Likes
The class of that thing is a Model
veilict
(MNSD_Vel)
#10
Then tween the PrimaryPart instead of the model itself, or the hinge as you said.
game:GetService("TweenService"):Create(workspace.ofdoor.Hinge, TweenInfo.new(1, Enum.EasingStyle.Quad), {CFrame = workspace.ofdoor.Hinge.CFrame * CFrame.Angles(0,math.rad(97.89),0)}):Play()
1 Like
Nah it just rotate the Hinge
.
1 Like
Hello? Are you still there ???
veilict
(MNSD_Vel)
#13
Weld all of the parts in the Model to the hinge using WeldConstraints.
Just insert a WeldConstraint for every part that isnt the hinge, set Part0 to that target part, then Part1 to the hinge.
![image](//devforum-uploads.s3.dualstack.us-east-2.amazonaws.com/uploads/original/5X/a/0/c/0/a0c05bc52cdaf6b3e87ba5847ed6b5fcd9be7f66.png)
Like this? Unfortaneatly it not work. It’s still only rotate the Hinge
anexpia
(anexpia)
#15
You need to unanchor all the parts except the hinge for them to rotate with it
Ok I will try that later. See you in some hours!
Thank you for your help! It worked!
system
(system)
Closed
#18
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.