I've been trying to get the front of a part named "Sidewalk" using normal d but it won't work,am I doing it wrong?
How can I get the front surface of the part named sidewalk?
Front = (Vector3.FromNormalId(Enum.NormalId.Front)) ---------------------------------------- Sidewalk = Instance.new("Part",workspace) Sidewalk.Size = Vector3.new(4, 1, 37) Sidewalk.Position = Vector3.new(4, 1, 37) Sidewalk.Name = "Sidewalk" Sidewalk.Anchored = true ---------------------------------------- FrontPosition = Sidewalk.Position*Front ---------------------------------------- Point = Instance.new("Part",workspace) Point.Position = FrontPosition Point.Name = "Point" Point.Anchored = true ---------------------------------------- print(FrontPosition)
A part faces front in the direction of its CFrame's lookVector
property.
FrontPosition = Sidewalk.Position -- From the middle + Sidewalk.CFrame.lookVector * Sidewalk.Size.z / 2 -- and a few studs out in the right direction
You should probably move Point
by settings its .CFrame
rather than its .Position
:
Point.CFrame = CFrame.new( FrontPosition )
This will mean it won't move out of the way of other objects.