You’ll be thankful to know that this code ended up on the cutting room floor.
I’ve realized at how impractical and inefficient of a way this was which honestly led to me scrapping the entire thing altogether.
Glad to hear I didn’t make a mistake.
However, even given the code, I still had problems with it as a whole. I figured out that it has to do something with the Camera and how the Plugin interacts with it:
-- snippet from my plugin code
local cameraChildren = camera:GetChildren()
mouse.Button1Down:Connect(function()
local hitPos = mouse.Hit
--If selection box was accidentally deleted
if cameraChildren == nil then
selectionBox() --function that produces another SelectionBox within the camera
end
if hitPos == nil then
camera.SelectionBox.Adornee = nil
return
end
camera.SelectionBox.Adornee = mouse.Target
end)
The problem is that the camera is having a hard time how to handle this. It’s like the mouse cursor and the camera aren’t getting along. When I don’t mess with the camera, this code is barely working, but when I mess with it while using the plugin, this code works great no problem.
I’m trying to create a plugin where when you click a Part/Model, the objects within it will be completely renamed and given their own unique names. (Sorta like Blender and how it gives its instances unique names when it a copy, hence why I’m exploring with Mouse.Target
as a test.)
As of right now, I’m just testing the waters of it since it’s my first time actually creating a plugin for myself, and how vague it seems to be on the DevHub, barely any tutorial videos on it.
I’m just trying to figure out how to have the mouse cursor select a part and have a SelectionBox around that clicked Part.
I’m creating a game game concept that’s going to be based on selecting specific parts within a complex model, and it really doesn’t help when all the objects within that model are named Part.
In all honesty, I could just go through the entire model of 160 parts and start naming them one by one, but by that point it just seems tedious and overwhelming.
Sorry for the long response.
Edit: I might take the solution response of mine off, depending on where this conversation leans toward. We’ll see.