Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

the error is ''Position is not a valid member of Model'', when i go check it it goes into line 15?

Asked by 4 years ago
01local Molly = script.Parent
02local humanoid = Molly.Humanoid
03 
04local PathfinderServise = game:GetService("PathfindingService")
05 
06local 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)
View all 37 lines...
1<pre class="brush: lua"></pre>
2 
3 
4 
5<pre class="brush: lua"></pre>

3 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You can't use Position at a model you have to use :MoveTo()

Ad
Log in to vote
0
Answered by
I_Nev 200 Moderation Voter
4 years ago

Try using destination.PrimaryPart.Position

Log in to vote
0
Answered by 4 years ago

Position isnt a property of a model. Since there is multiple parts in a model so you would have to use :MoveTo()

Answer this question