So i am using PivotTo in order to move doors, but when i try setting the orientation to: 0,90,0 i get this:
Instead of this
I am tired of this, i hope i will get a reply soon.
So i am using PivotTo in order to move doors, but when i try setting the orientation to: 0,90,0 i get this:
Send your script as well so I can understand better
--Example position
workspace.DevTest.DoorCl:PivotTo(CFrame.new(Vector3.new(-86.023, 3.891, -20.926),Vector3.new(0,90,0)))
Why are you using PivotTo?
TweenService allows you to have a door hinge that’s Anchored with all the other Parts of the moving door unanchored and welded to the Anchored hinge.
When you tween the Anchored hinge’s Orientation it’ll open the door, and you can use a bunch of different styles of movement to change the ‘animation’ of the door.
its not for animating, its to put the door in place
the opening animation does use tweenservice
What I would do is set the biggest part closest to the center of model as the primary part of the model, and then weld every other part onto the primary part. Then you can just set the cframe of the primary part and all the other parts in the model will stay attached.
When you select the door (or door model) with the Move tool how are the orientation arrows pointing?
normally
the selection box is bigger because of the hitbox
hmm i noticed that when i try to set it to 0,0,0 it becomes: -2.517, -103.672, 0
--Example position
workspace.DevTest.DoorCl:PivotTo(CFrame.new(-86.023, 3.891, -20.926) * CFrame.Angles(0,math.pi / 2,0))
Is this room a model that’s going to be moved around with the door in it? Or is it like a wall that will be added to the room and the door is a separate model that a player is adding?
Just trying to understand why you’re using scripting to move the door.
the door is just a model and it wont move around, when i try to move it to its position it breaks. it is all anchored (excep the door knob and sign, these are welded and unanchored)
I don’t understand why you are trying to move the door to another Position if it’s already placed in the right spot. Doors rotate on a hinge, you can use this as your Tween.
So instead of tweening its Position, have an anchored Hinge part like I mentioned above.
Weld all the other door Parts to the anchored hinge and make the door parts unanchored, then just tween the Orientation of the Hinge part.
Ta-daah! No positional work required.
The PrimaryPart should be an invisible part that aligns with your rotation, acting as a sort of hinge
Maybe try:
workspace.DevTest.DoorCl:PivotTo(CFrame.new(Vector3.new(-86.023, 3.891, -20.926) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0)))