Attempt to index nil with 'Position'

I got an error
Players.uknown_personPRO.PlayerGui.TowerPlacementGui.Frame.Main:23: attempt to index nil with ‘Position’
Im trying to make the Humanoid root part go to the plrs mouse

Here is my code
local plr = game.Players.LocalPlayer

for i, frames in pairs(script.Parent:GetChildren()) do
if frames:IsA(“ImageLabel”) and frames:FindFirstChild(“Place”) then
if not plr[frames.Name].Value ~= “Empty” then
if script.Placing.Value ~= nil then
local mouse = plr:GetMouse()
script.Placing.Value = frames
local t = false
while script.Placing.Value ~= nil do
if t == false then
local tower = game.ReplicatedStorage.Towers:FindFirstChild(plr[frames.Name].Value)
if tower then
tower.Name = plr.Name…plr[frames.Name].Value
tower:Clone().Parent = game.Workspace
if game.Workspace:FindFirstChild(plr.Name…plr[frames.Name].Value) then
local part = mouse.Target
game.Workspace:FindFirstChild(plr.Name…plr[frames.Name].Value).HumanoidRootPart:FindFirstChild(“BodyPosition”).Position =, part.Position.Y, mouse.Hit.p.Z)
elseif script.Placing.Value ~= nil and script.Placing.Value == frames then
script.Placing.Value = nil

	frames:WaitForChild("Name").Text = plr[frames.Name].Value
		frames:WaitForChild("Name").Text = plr[frames.Name].Value


1 Like

The error states that position is not a property of nil meaning that the instance before position doesn’t exist.

Try changing .HumanoidRootPart:FindFirstChild(“BodyPosition”).Position =, part.Position.Y, mouse.Hit.p.Z) to just

.HumanoidRootPart.CFrame =

Let me know if that works

When i delete :FindFirstChild(“BodyPosition”) It brings up the same error

It works kida but the model virbites to much and it moves towerd the player then telports back some how

Is there an upper limit as to how far the player can teleport?

What do you mean by upper limit?

If the mouse is, say, pointed at the very end of the map, will it still teleport there or is there a limit as to how far the player can teleport? That being said, try this:

It will go there there is no limit to how far you can move the character.

Okay then try this:

.HumanoidRootPart.CFrame =,2,0)))

Or is the player still vibrating?
Edit: Sorry I just realized I copy and pasted my whole code, I just meant to give you what’s above, my bad

Its not vibrating any more but it goes up and down now

Can you send me a gif of what you mean? Like is it moving really quick?

I see, is it possible that there is a script within the cloned instance that is affecting it’s movement?

What do you mean by cloned instance in the script?

Is it possible that a script is making the little green guy
move up and down? What scripts does it have, if any?

The green guy is a module from a differt folder in the replicated folder. Well there are no scripts in him.

That’s weird then, I’m not sure what could be causing it to move like that. Does it have an odd hitbox?

I dont think so. Its just a normel character that’s size is much smaller.

That might be the problem then. Can you get me the full height of the character (zombie guy)?