#arrows arent aligned right quite well does anyone know why?

8 messages · Page 1 of 1 (latest)

pseudo ibex
#
function mob.CreateArrow()
    for i=0,2 do
        local arrow = game.ServerStorage.Arrow.Arrow:Clone()
        local AP = Instance.new("AlignPosition", arrow)
        local AO = Instance.new("AlignOrientation", arrow)
        local waypoint = workspace.Map:FindFirstChild(workspace.Map:GetAttribute("Map")).Waypoints:GetChildren()[1].Attachment
        local mag = (arrow.Detect.WorldPosition - arrow.Position).Magnitude
        arrow.Parent = workspace
        arrow:SetNetworkOwner(nil)
        AP.Attachment0 = arrow.Detect
        AP.MaxForce = math.huge
        AP.MaxVelocity = 25
        AP.Responsiveness = 200
        AO.Responsiveness = 25
        AO.Attachment0 = arrow.Detect
        arrow.CFrame = CFrame.new(waypoint.WorldPosition.X, waypoint.WorldPosition.Y + mag, waypoint.WorldPosition.Z) + arrow.CFrame.LookVector * -i * 1.1
        coroutine.wrap(mob.MoveArrow)(arrow)
    end
end
function mob.MoveArrow(arrow)
    local map = workspace.Map
    local waypoints = map:FindFirstChild(map:GetAttribute("Map")).Waypoints
    local waypointss = waypoints:GetChildren()
    local noY = Vector3.new(1,0,1)
    for waypoint= 1,#waypointss do
        local currentwaypoint = map:FindFirstChild(map:GetAttribute("Map")).Waypoints:GetChildren()[waypoint]
        local AP = arrow.AlignPosition
        local AO = arrow.AlignOrientation
        
        AP.Attachment1 = currentwaypoint.Attachment
        AO.Attachment1 =  currentwaypoint.Attachment
        AP.Mode = Enum.PositionAlignmentMode.OneAttachment
        AP.Position =  currentwaypoint.Attachment.WorldPosition
        local magn = (arrow.Detect.WorldPosition * noY - currentwaypoint.Attachment.WorldPosition * noY).Magnitude
        repeat
            magn = (arrow.Detect.WorldPosition * noY - currentwaypoint.Attachment.WorldPosition * noY).Magnitude
            task.wait()
        until magn < 0.15
    end
    arrow:Destroy()
end
atomic hare
#

You need to start turning before hitting the waypoint, or increase the turn speed

pseudo ibex
#

they arent perfectly alligned

#

before utrning too

#

like when they spawn