Hey again devforum, Im once again requestion some of your limitless knowledge.
I wanna make a build a boat for treasure style move, scale, and rotate tools for a sandbox game im working on. but I dont know where to start or how to go about doing this sort of thing. any help would be appreciated, thanks in advance!
sorry if this is hard to read in any way, I dont normally write stuff so im not so good at it.
This is a very unspecific question. You are asking how to make a very advanced system with many different features.
Try starting with a basic grid building system and build on top of it later.
You can for sure find tutorials on that, but briefly you need to get the player’s mouse position (mouse.Hit.p), round the positions to fit some kind of grid and clone your block/object there.
Sorry, im hella tired rn.
Im not quite looking for some simple grid thing, just sorta a dragger that scales the part. im well aware of mouse.p and stuff but i have no clue how i could use that to tell how many studs the dragger was dragged. if that makes any semblance of sense
Oh sorry, I missunderstood.
To make a dragger I’d suggest you add handles (parts) around the object.
While the player is holding the handle, you’ll have to do a bunch of calculations. To get the distance dragged I came up with something like this.
(This would only work for dragging on the X-axis. You’d have to somehow differentiate between each handle and make it drag on the correct axis.)
--Handle's distance from camera
local handleDistance = (handlePos - camera.CFrame.p).magnitude
--The mouse's facing direction
local mouseDirection = mouse.UnitRay.Direction
--The point in 3D space the camera is looking at.
local rayPos = (camera.CFrame + mouseDirection * handleDistance).p
--The total distance it has been dragged
local distanceOnAxis = handle.Position.X + rayPos.X
With the distanceOnAxis, you can now reposition the handle and do whatever you want with the object (reposition, resize…).