Lets say we have a base named part.
psize = workspace.Part.Size -- Vector3.new(100, 1, 100) ppos = workspace.Part.Position --Vector3.new(0, 0, 0)
Through scripting I want to find a corner position of this part which would be (50, 0, 50)
I have no clue how to go about this though.
Is there a way to pull the x/y/z values from a vector3 value assigned to a variable?
Thoughts V
Position - (a, b, c) /////// Size - (d, e, f) ///////// (Position+(.5d))+(Position+(.5f)) //// would give me the above corner.
A part has 8 corners. You can get the components of a Vector3 by its x, y, z elements. You don't need to use them, though.
local psize=workspace.Part.Size local ppos=workspace.Part.Position local offsets={ Vector3.new(.5,.5,.5); Vector3.new(.5,.5,-.5); Vector3.new(.5,-.5,.5); Vector3.new(-.5,.5,.5); } local corners={} for _,v in pairs(offsets)do corners[#corners+1]=ppos+psize*v corners[#corners+1]=ppos-psize*v end