First time using a skinned mesh monster but basically i’ve got into blender and set his front position to be the front of the mesh and for some reason my monster wont turn towards the target it kinda just strafes (i’ve included a video to explain better + decals showing the face of the monster)
local players = game:GetService("Players")
local runService = game:GetService("RunService")
local hound = script.Parent
local humanoid = hound:FindFirstChild("Humanoid")
local houndRootPart = hound.PrimaryPart
local maxDistance = 50
local minDistance = 6.5
function findClosestPlayer()
local playerList = players:GetPlayers()
local closestPlayer = nil
local magnitude = nil
local position = nil
for i, player in pairs(playerList) do
local character = player.Character
if not character then return end
local distanceVector = (character.HumanoidRootPart.Position - houndRootPart.Position)
if not closestPlayer then
closestPlayer = player
magnitude = distanceVector.Magnitude
position = distanceVector.Unit
elseif distanceVector.Magnitude < magnitude then
closestPlayer = player
magnitude = distanceVector.Magnitude
position = distanceVector.Unit
end
end
return closestPlayer, magnitude, position
end
runService.Heartbeat:Connect(function()
local closestPlayer, magnitude, position = findClosestPlayer()
if closestPlayer then
if magnitude <= maxDistance and magnitude >= minDistance then
humanoid:Move(position)
else
humanoid:Move(Vector3.new())
end
end
end)