I’ve been looking this all over the place, haven’t found anything so far.
So basically what I’m trying to accomplish here is trying to get the amount of studs in between 2 points, in this case 2 parts.
Usually I would use magnitude for this, but this isn’t quite working for the result I’m trying to get. I made these images to show what I’m looking for, any help is appreciated!
The actual result I’m looking for.
The result that magnitude gives me, It returns the amount of studs from the center of the part. But that’s not what I want as shown in the image above
I’ve actually thought of that, but the thing is I would constantly need to position that attachment since the part was used for an example. In the real thing I’m using the player to check it [HumanoidRootPart] the player is constantly moving so wouldn’t be really efficient.
local P1 = script.Parent.Part1
local P2 = script.Parent.Part2
while wait() do
local POS1 = P1.Position
local POS2 = P2.Position
print((POS1 - Vector3.new(POS1.X,POS1.Y,POS2.Z)).Magnitude)
end
Update, I got a rough understanding how to accomplish this.
Thank you to @Pokemoncraft5290 Pokemoncraft5290