What is Part.Position.Unit?

I just want to learn everything or mostly everything about scripting, so I can start developing

I dont understand what

Part.Position.Unit

Is

I’ve tried looking for something in the API Reference and DevForum, and couldn’t find anything

2 Likes

It’s basically a normal copy of the Part’s Vector3 position. It has the same direction but a magnitude of 1.

Vector3 | Roblox Creator Documentation — Magnitude.

1 Like

Imagine an arrow going from 0,0,0 to the part’s position.

Slapping a .Unit on there makes a new arrow, starting at 0,0,0 and heading in the same direction. Except it’s only 1 stud long.

You get the position of that new arrows tip.

I have no idea when you’d want to use .Unit with Position, though.

4 Likes

Thanks Peter and nicemike, I think I understand what .Unit does
so if we have a variable called

local unit = (endPart.Position - Start.Position).Unit
print(Unit)

I think it prints the direction the EndPart is at from the Start

Well if this is what it means, thank you!

1 Like

The variables name is unit with a lower-case. You are printing Unit with an uppercause U.