EZ Pathfinding v5

Good day,

Can someone please help with the error below, I am trying to use EZ Pathfinding but it keeps saying my Vector3 is not valid. I am trying to specify the location of the NPC to move to.

Error Position is not a valid member of Vector3

local mod = require(WorkSpace:FindFirstChild(“PathfindingV5”))
local goalPos = workspace.Goal
local npc = script.Parent

local path = mod.new (npc, **Vector3.new(goalPos.Position.X,goalPos.Position.Y,goalPos.Position.Y))**


You can just replace this part with “goalPos”, it’s erroring because you are doing goalPos.Position, when goalPos only has the properties X, Y and Z.

Is goalPos a part or what? and why do you have stars before and after the Vector3?

I’m assuming the Goal in workspace is a model. You can’t get a position from a model, it must be a part. so you should put a part in the model or use a part from the model and get it’s position instead

Hi, thanks for the help,

The code below fails with the same error “Position is not a valid member of Vector3”

local path = mod.new (npc, Vector3.new(goalPos))

goalPos is just a basic part in the workspace I want the NPC to travel to.

EZ Pathfinder called function

function Path.new(Target, Endpoint)
	--@ Creates a new path.
	local params = {AgentRadius = AgentRadius1, AgentHeight = AgentHeight1, AgentCanJump = AgentCanJump1}
	local path = PathFindingService:CreatePath(params)
	local self = {
		["Target"] = Target;
		["Time"] = Path.CalculateTimeRaw(Target, Endpoint);
		["Endpoint"] = Endpoint;
		["CurrentWaypointIndex"] = 1;
		["Walkspeed"] = 16;
		["JumpPower"] = 100;
	if Target then
		self["Path"] = path
		if Target:FindFirstChildOfClass("Humanoid") then
			--@ Target is a rig
			self["Humanoid"] = Target:FindFirstChildOfClass("Humanoid")
			local RootPart = Target:WaitForChild("HumanoidRootPart")
			if typeof(Endpoint) == "Vector3" or typeof(Endpoint) == "Instance" then
				path:ComputeAsync(RootPart.Position, Endpoint.Position)
				path.Blocked:Connect(OnPathBlocked, Target, Endpoint, self["CurrentWaypointIndex"])
					onWaypointReached(status, self, Target, self["CurrentWaypointIndex"], path:GetWaypoints())
			--@ Target class is not a rig
			if typeof(Endpoint) == "Vector3" or typeof(Endpoint) == "Instance" then
				path:ComputeAsync(Target.Position, Endpoint.Position)
			self["TweenPause"] = false
			self["TweenStop"] = false
	return setmetatable(self, Path)

path:ComputeAsync(RootPart.Position, Endpoint.Position) change this line to
path:ComputeAsync(RootPart.Position, Endpoint)