How would I go about making a door that opens and walks you through it like adopt me?

So I am mainly a builder and I am working on a adoption game atm. I was wondering if anyone on the forum could give me a guide on how to do this. I just started programming a little bit ago, so I barely know anything. Thanks in advance.

2 Likes

I won’t say it’s hard. But if you don’t have knowledge on scripting. i suggest trying something else.
But basically you’ll need to CFrame the doors, Which simply changes it’s rotation and position to rotate around an axis. and then you’re going to call a function called MoveTo(Position) inside the humanoid. that will move the player character to the specified position

1 Like

Maybe this video can help you a little with CFraming:

2 Likes

Hello, please start by using this category in its proper capacity. Not everyone on the Developer Forums plays Adopt Me, so it’s not possible to know what you are thinking of without a reference. Please upload a video or screenshot about what you’re hoping to accomplish and tailor your question mainly to the problem you’re trying to resolve and not to “how did X do Y”: we won’t know.

Furthermore, remember that this category isn’t for asking for free code or for systems to be written for you. You will have to put in a lot of the effort yourself to attempt this problem first. You can familiarise yourself with the Roblox environment by looking through the Developer Hub and there are many resources for getting started with programming if that’s how back you need to go.

3 Likes

Not sure how Adopt Me doors work, but I have a HingeConstraint door model I made for someone on the forums asking about them. The HingeConstraint is set to Servo mode, and if you step on the pad in the floor (you can make it transparent) the door swings like a real door, one way, then closes.
I made it this way so players on any device can go through the door.

7 Likes

There are multiple ways you could approach this problem, I haven’t played Adopt Me but, as colbert2677 stated above, this section isn’t for free code so, I won’t be providing code, instead, some potential solutions.

  • You could tween doors (One of the easiest options)
    You could tween doors by adding a part as a hinge and rotating it using CFrames; CFrames use radians which means you will have to convert from degrees to radians. The door should be welded to the hinge, so it rotates. If you want to do this on the server, you could load the tweens on the server and play them when a remote is fired (refrain from creating a tween every time a remote is fired, tweens are instances so, remember to remove them properly if you do use them to prevent memory leaks).

  • You could modify the CFrame of a door directly
    This method would probably require some knowledge on CFrames but, it shouldn’t be difficult to grasp. There are multiple ways you could approach this, you could create a CFrame which will be rotated then multiplied by an offset removing the need for a “hinge”, you could also use a part welded to a door behaving like a “hinge” or, you could use a part that will behave like a hinge and, you could modify its CFrame instead.
    If I’ve confused you (I’m sorry if I have), I recommend watching the video linked by @IlyasTawawe above.

  • You could also use hinge constraints
    I’ve never personally used hinge constrains but, I’m sure @Scottifly has a great example.

You mentioned a door the opens up and moves the player through, I’m going to assume this is automatic, one way you could achieve this is through the use of :MoveTo a function/method that can be called on the players Humanoid, it takes the arguments Vector3 location and Instance part, the second argument stated isn’t required, you’ll only need to pass a Vector3 location into the function/method.

Note: These aren’t all the possible solutions

4 Likes

one question, could u make it so the door like swings open really fast

1 Like

Easy, go into the HingeConstraint

and in the Properties window change the AngularSpeed setting. Remember it’s in Radians/second so take the value I put in there and increase it slightly, then test the place out. You can mess with the value while in Test mode to get it how fast you want it, and you can also change the wait() time to make it stay open longer or shorter.
The TargetAngle and the UpperAngle (might be the LowerAngle, can’t remember which way I have it opening) can be changed to make the door open more or less.

2 Likes

How do you make it so when you step off the switch platform the door closes

1 Like

Check out the wiki:

Haven’t used TouchEnded at all, but I’m not sure if it’s actually the answer since I know that you need a debounce when a player touches an object otherwise the script will keep firing because any of the player’s parts that touches the object will operate the script. It’s probably the same for TouchEnded too because if the player touches the part multiple times then it means they probably will end touching it multiple times too.

Srry for late response but here is a video that shows how to do it.