01 | local Molly = script.Parent |
02 | local humanoid = Molly.Humanoid |
03 |
04 | local PathfinderServise = game:GetService( "PathfindingService" ) |
05 |
06 | local function getPath(destination) |
07 | local pathParams = { |
08 | [ 'AgentHeight' ] = 6 , |
09 | [ 'AgentRadius' ] = 2 , |
10 | [ 'AgentCanJump' ] = false |
11 |
12 | } |
13 | local path = PathfinderServise:CreatePath(pathParams) |
14 |
15 | path:ComputeAsync(Molly.HumanoidRootPart.Position, destination.Position) |
1 | <pre class = "brush: lua" ></pre> |
2 |
3 |
4 |
5 | <pre class = "brush: lua" ></pre> |
You can't use Position at a model you have to use :MoveTo()
Position isnt a property of a model. Since there is multiple parts in a model so you would have to use :MoveTo()