Hello. I am not an expert in scripting and I am still learning. I need help regarding the doors in our game. All doors were working perfectly fine before but they suddenly became broken. They still have a sound when being opened but they only slightly open (all doors from toolbox also have this problem). I tried these doors in another game and they worked. May I know what the problem might be and how I can fix it? Thank you to those who will respond.
#Door help
1 messages · Page 1 of 1 (latest)
Nobody can do as much as guess without the code, please send the code that handles doors.
This is the code. All doors were from toolbox and they worked before until they just didn't so I fear the problem might be the overall script (I don't know the term for it)? Maybe something was added or removed. I really don't know.
Hmm, try using TweenService for animating the doors instead
Also some other tips
:SetPrimaryPartCFrame()is depreciated, use:PivotTo()insteadwait()is depreciated, usetask.wait()insteadCollectionsServiceCan be used to clean up duplicated scripts. You can give every door a tag and run a single script on every door that has the tag.
Thank you very much. Also, I just realized right now that they are actually working but they open at a very slow rate so it made it seem like they were not working (maybe due to lagging or having too many models?). Is there a way to fix this? Thank you in advance.
The code you sent should open the door in 20 frames
Your in studio which means the server performance will effect your client framerate. Is the game laggy at all?
I'd also try copy-pasting the door into a fresh studio instance to see if that resolves the issue
The game isn’t laggy I think because my character runs and walks smoothly. However the doors open very slowly.
I tried this and the door opens smoothly and as intended. Is there a way to reduce this “lag”?
If its opening very slowly i'd recommend just increasing the amount it rotates by maybe
/decreasing the time till end
Thats very weird. I'd have to know more about your place to actually know whats wrong.
I'd recommend creating a copy of your place and deleting half of everything (binary search esque) until you find whatevers causing the doors to open slow.
Will try this. Thank you!
** You are now Level 1! **