I’ve tried to make a script that cuts a hole in a wall (like a boolean), but when moving the part that cuts the window, it leaves behind empty space!
I’ve tried fixing the wall when the part moves. But without knowing where the original surface is, you can’t do much. Also, saving the wall in a variable somewhere won’t work cause this is apart of a building script. You can player walls and move windows through them.
A solution that doesn’t cause much lag will be the best, but I’m fine with a small drop in frames.
Thanks and have a great day
Can we see some code? I can’t help you if you won’t show any code.
These posts got me to where I am right now
This is most likely because you are trying to cut it in a loop. So when you move it while it’s looping, it’ll cut as it moves. Maybe you could try checking if the part’s position is constantly changing? If you check that before cutting, then you could probably get your desired result.
Also, there’s no real way to fix the frame drop that happens when you’re cutting an object. That’s simply Roblox Studio splitting it apart and having to do all the calculations…
Yeah, I have no real clue on how to help you the most here since I literally don’t have any code to work with, lol.
Here is an example of what I mean by “checking if the part’s position is constantly moving”
local lastPosition = cutternamehere.Position -- Store the Cutter's position inside the code.
-- In here, we'll check what the cutter's last position was and compare it to the new position.
-- If it isn't different, cut.
if lastPosition == cutternamehere.Position then
-- put the cutter's code here
-- Then update the cutter's position.
lastPosition = cutternamehere.Position
This is apart of a placement system, so the window has to move. Bloxburg is a good example of what I’m trying to achive
That isn’t what I was trying to do, lol.
Essentially, my script compares the last position and the new position and cuts if the same. You can still move it, but it won’t cut while moving. Instead, when you stop moving, it’ll cut. I wasn’t trying to prevent you from moving it.
Okay, so I looked at the first post here. I see what you need now. You want the hole restored after moving, yes? I have no clue on how to help with that, as I’ve never worked with this kind of stuff before. I’d suggest using EgoMoose’s solution on the “Parts to parts break to fit window, door” question. He basically fixed the entire issue of blank space being left behind, but otherwise, I cannot help you. I hope you have a great day though!
That’s what I used in the example. The problem is I don’t know how to fix the wall then cut it