Best method to create a 3d resizable cube

  1. What do you want to achieve? Keep it simple and clear!

Hello fellow scripters!

Inside Roblox studio you can spawn in a part and resize it however you want. I really like this resizing feature as its very intuitive and easy to understand. I want to recreate this using scripts but am unsure on the best way to tackle it.

I want this resizing feature to be accessible on both pc and mobile devices and want a resizing limit.

I’ve tried using rods with billboard guis as the handles to have them slide on each axis however I’m unable to figure out how to script the mechanic. This solution also seems a little hacky imo probably a better way to do the handles.

If you have had any past experiences with scripting these kind of features OR think you know how to do this please let me know!
ConceptA


CubeResize2

If what you’re having problem with is making the part resize while maintaining its position, could you not resize the part, then move the cframe based off of how it was resized? Let’s say the user drags the right dragger, increasing the size of the part on the X axis by 1 stud. Just shift the cframe of the part over to the left by 1 stud to account for this offset. If you’re having problem with detecting the dragging motion, Mouse.Delta is a thing, or you could script your own method to detect movement with the Mouse X and Y positions when the button is held down

Edit: you would shift it by half of the amount it was resized.

Now for the draggers, you can use CFrame:ToWorldSpace to line up the draggers with the part. Move it based off the mouse delta. This gif just shows its possible to use ToWorldSpace to get a dragger to line up with a part’s cframe. It will work no matter the rotation/position.

1 Like

They’re already available.
Handles | Documentation - Roblox Creator Hub
ArcHandles | Documentation - Roblox Creator Hub

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.