So i’ve been trying to make a particular door system which i rlly liked but didn’t know how to make it’s feature.Here is a showcase of what i mean :
As you can see you can open/ close the door Lock it or even break it!
If anyone can help me make that it would be rlly appreciated!
If you want more detail on the Breaking (You should press E to break multiple times to break the door)
Make functions for the ProximityPrompts and use TweenService or another way to open the doors (Such as Constraints).
With breaking it, use ProximityPrompt events and you could change anchored to false, or you can make it more advanced.
Events:
PromptTriggered -- Fires when a player interacts with a prompt (after the duration for a prompt with non-zero HoldDuration).
PromptTriggerEnded -- Triggers when the player stops interacting with a prompt.
PromptButtonHoldBegan -- Fires when a player begins interacting with a prompt of non-zero HoldDuration.
PromptButtonHoldEnded -- Fires when a player stops interacting with a prompt of non-zero HoldDuration
I think you were talking about locking because anchoring the door is like if it’s locked.
If you didn’t then can you explain more how would i go about making the breaking system?
No, I was not talking about locking. I was talking about opening, closing, and breaking. If you want to do a lock system, then you can use a ProximityPrompt function. Once the ProximityPrompt is triggered, then you can set a boolvalue to true. At the start of the function, you can check if the bool value is set to true or false to check if it is locked or unlocked.
Well, you can use a ProximityPrompt function. Once that is triggered, then you can set anchored to false and break welds (if needed). You can make it more advanced with TweenService if you want.
Use can use Proximity Prompts to code what happens when the player opens the door.
You might need to use RemoteEvents to fire this to the local player. The local script should be inside StarterPlayerScripts. A server script inside the proximity prompt can fire the event. TweenService can be used inside the local script and the sound can be placed inside the local script.
You can’t just use Bodyforce for making the part move like that.
Bodyforce is mainly used for changing gravity.
For moving the part back like you said, you can use TweenService and change the TweenInfo for speed, or you can use Vector3 to move the part.
Also it seems like a good idea to use Velocity in this case.