Hello there!
I want to extend the plane to the pink part with a script
I tried setting the size to (pink spart's position - plane's position).Magnitude * 2
But It didn’t work
I want to extend the plane to the pink part with a script
I tried setting the size to (pink spart's position - plane's position).Magnitude * 2
But It didn’t work
Here is some results I got:
local Part = script.Parent
local Ball = workspace.ball
local calculated_distance = (Part.Position - Ball.Position).Magnitude
local Xsize, Ysize, Zsize = Part.Size.X, Part.Size.Y, Part.Size.Z
Part.Size = Vector3.new(Xsize, Ysize, calculated_distance)
Part:PivotTo(CFrame.new(Part.Position, Ball.Position) * CFrame.new(0, 0, -calculated_distance * .5))
PartToBall.rbxl (53.5 KB)
This worked but I couldn’t quite adjust it to my code, because what I’m trying to achieve is this
The part should be in contact with every single pink spot, the only thing that should remain the same is the Y axis
You could group it as a model and use bounding box.
and according by roblox studio guidlines you should NOT ask someone for writing the whole systems/scripts.
Incase you didn’t read my post, im not asking for the full system, im asking for the logic behind setting the part’s size to another part position. and yes I didn’t think about bounding box, that should work, thank you.
you’re welcome! Just be careful with those thing. I got banned a few times cause of this rule.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.