How to recreate this door system?

I’m sorry to bother anyone with this, as this may be very simple, but I’m new to scripting, and making devforum posts, so I’m also sorry if something is put wrong. thank you for your time, and for you responding to this.

I want to recreate something alike to the video below. but I have no idea how to. and more importantly, I want to be able to change it depending on the door, gate, trapdoor, and such, and have it reopen the next time someone opens the door. Not just move the camera, and have the door remain open from the last time someone opened it, as it’ll look very funny.

thank you again for your time, this means the world to me.

edit: from a response I made below. I’m trying to figure out how to entirely recreate the video 1 to 1 in roblox, as when you open the door, it moves your camera to a black room with a door opening, as seen in the video. I hope this makes more sense for anyone confused about what I’m trying to make

edit2: to give an example, say, the player walks up to a door, and they click on it. it moves their camera to a black box with a copy of that door, same texture and all [ I say this, as I want to have different textured doors, and have the door opening reflect that texture, it’s like a cutscene that changes depending on the door ]. and then opens the door, and moves the camera forward. while all of this is happening, it teleports the player to another room, and moves the camera back to first person. I hope this makes more sense

5 Likes

Not sure if you just want a door system or something else as well. If the former:

3 Likes

Maybe using tween services?. an example is: game:GetService(“TweenService”):Create(script.Parent, TweenInfo.new(2, Enum.EasingStyle.Exponential), { Cframe = Cframe1 }):Play()

3 Likes

first of all, thank you so much for responding, this helps me.

I’m sorry if this was confusing any, but I’m trying to figure out how to entirely recreate the video 1 to 1 in roblox, as when you open the door, it moves your camera to a black room with a door opening, as seen in the video. I hope this makes more sense for you, and anyone else who reads post,

2 Likes

thank you so much for responding, this should help me as well

3 Likes

There are some simple steps to accomplish a similar style game:

  1. Add a black background, I would suggest adding a black skybox
  2. Create the door by making the wood part. Create another part that is to the side of the door that you want it to open from. The second part should be anchored and will serve as your door hinge.
  3. Create two camera parts, one at the front of the door and one at the end. (to make sure they face the right direction, you can add a SurfaceSelection with the Adornee as the camera part and the surface as Front. The side with the selection on it will be the way the camera is facing once you set the part as your camera)
  4. Create a local script in StarterPlayer > StarterPlayerScripts where you set the CameraType to Scriptable then set the CFrame to the first camera part, then you can use TweenService to tween the door hinge into the open direction and then use TweenService again to tween the camera to the second camera part.

This documentation may help:

I suggest looking through other posts if you have any questions but feel free to ask me any if you can’t find the answers you’re looking for.

3 Likes

thank you so much for responding, this gives me more of an idea of how to achieve my goals, so I’m thankful for that. when I get the chance I’ll try to put what you said into practice. I’ll be sure to ask if I can’t find the answers, thank you again

1 Like

I’ve updated the post to have a better idea of what I’m trying to achieve, I hope this makes sense

1 Like

I’d recommend using a ViewportFrame for this since it wouldn’t require modifying the actual game camera

2 Likes

thank you so much for responding. sadly, viewport frame comes with issues, such as no shadows, and is overall not something I’m entirely aiming to have in my game as it’s often works weird, at least from what I’ve seen. again, thank you for responding, I’m sorry if any of this is rude

2 Likes

not sure if i’m much help, but you should use tweenservice for the door and tweenservice for moving the camera too.
if you’re NEW new, then you should look for a tutorial on tweenservice.
here’s one that i found

i’m not gonna spoonfeed the entire script for you, but i’ll give you an idea on what to do

create all the stuff beforehand, like make a camera object, make the black box, make the door. put the camera and the door in the black box

first, set up all the variables like tweenservice and the player. if it’s a localscript, use localplayer. if it’s a serverscript, grab the player value from which player clicked the door. (... .MouseClick:Connect(function(player)))

set up some of your tweens: the door and the camera moving forward.

set the camera mode to scripted when someone clicks the door, set workspace.CurrentCamera’s cframe to the camera object, do that stuff.

now, the black box is a good idea, but players and you may notice there’s walls, so you should utilize black fog in this situation. turn fog on during the cutscene, when it’s done turn it off.

play your door tween,
<doortween>.Completed:Wait()
play the camera tween,
<cameratween>.Completed:Wait()
then set camera mode back to it’s original mode and and then reset the door and the camera back to it’s original position.

anyway here’s pseudocode:

variables for tweenservice, and all the other stuff like doors and cameras and currentcamera
all your tweens for the door and the camera

on click function(()

turn fog on

change cameramode to scripted
currentcamera cframe = cutscene camera cframe

play your door tween,
wait until it’s done,
play camera tween,
wait until it’s done,
teleport player

turn off fog
set cameramode back to normal
reset positions for door and camera
end)

also you should do this on a localscript!

hopefully this helps. thank you for reading.

2 Likes

thank you so much for responding, and it helps a lot. thank you for taking the time to write this, as I know it must have taken you a good bit. you did great at explaining, and of course you’re a help, thank you again, it means a lot, I’ll try to put this into practice

1 Like

thank you for your feedback! i was worried i’d gone a little overboard there, heh.

2 Likes

thank you for being kind, and for the help, I hope you’re doing well

1 Like

update, I’ve been struggling with this, maybe because I’m making it too complex, and therefor have no idea how to get what I’m trying to achieve. to explain, I’ve been trying to make a system where instead of the “cutscene” running in the part, “aka, when you click, it runs a script in the part that handles the cutscene” it instead runs in a place like startergui, but I’m not fully sure if this is possible. I’m trying to create it as if it’s a module, that I can just simply call instead of putting a script inside of every door, if that makes sense. I guess my point is, I’d rather have one script that handles it all, such as, detects value of door, the value says wood, so it sets the texture of the door to wood, then plays the “cutscene” for the player, all running in the same script, not a ton of scripts inside a ton of doors, you know? but I don’t fully understand if it’s better to do such like this, but I also feel like it’d be easier to use. I hope this makes sense, if it doesn’t, please ask me to explain more

1 Like