Model spawns in wrong area?

Im making a item / model spawner for developers and im wondering what i did wrong i looked at a tutorial of course lol but im wondering why it wont spawn in the right place heres a video of what i mean
robloxapp-20210712-1147193.wmv (3.1 MB)
Screenshot incase you dont trust download things


Notice how it spawns somewhere completely diffrent to where im standng the little brick i was spinning my mouse around is where its suspose to spawn at but it did not the tool is in server storage in a folder and he place the trucks are spawning at is where the brick was when i put the tool in server
storage.
Code for the button gui:

local cybertruck = game.ServerStorage.ModelSpawnerFolder.Cybertruck
local button = script.Parent
local gui = script.Parent.Parent.Parent.Parent
local targetpart = game.ServerStorage.DevTools.SpawnerTool.TargetPart
local cooldown = false
button.MouseButton1Click:Connect(function()
    if cooldown == false then
	cooldown = true
	local clone = game.ServerStorage.ModelSpawnerFolder.Cybertruck:Clone()
	local cframe = targetpart.CFrame
	clone:SetPrimaryPartCFrame(cframe)
	clone.Parent = game.Workspace
	button.Text = "Cooldown for 2 seconds.."
	wait(2)
	cooldown  = false
	 button.Text = "CyberTruck"
   end
end)

Also i dont know if this is the right topic

can you give us the code? (30)

1 Like

The topic has now been updated with the code.

maybe set the target part’s parent as workspace?

1 Like

But the target part is inside the tool heres the workspace:
Yes1
This is inside server storage by the way

where was the target part, is it the brick?

1 Like

The brick i showed in the video? Yes thats the target part.

maybe switch to:

clone:MoveTo(targetpart.Position)

try, also I’m gonna sleep now so I’ll let others do it if it doesn’t work

1 Like

Do you mind uploading this video to YouTube or Streamable? Users such as myself don’t take a gamble by downloading random video files, and it’s less convenient regardless.

2 Likes

But the thing im spawning in is a model not a part arent models suspose to use CFrame and not Position?

I dont know how to upload as a streamable and heres a screenshot showing whats happening ill put it in the original pst also i understand your reasoning


The arrow pointing to the brick is where it should be spawning the circle with the trucks is where there spawning.

You are using physics bodies; physics are only simulated while in the workspace.

When spawned in workspace, optionally call :MakeJoints(), and then set the primary part cframe.

1 Like

Where do i put this at? As i have not learned what this does yet im still a beginner

Just swap the following lines:

clone:SetPrimaryPartCFrame(cframe)
clone.Parent = game.Workspace

as a side note, you don’t need to type game.Workspace. You can just type workspace.

1 Like

Still spawns in the same area unless i did the code wrong heres what i did

clone.Parent = workspace

clone:SetPrimaryPartCFrame(cframe)

I just realized the Target is inside a tool for whatever reason. When you move, the target moves, causing this behavior. Basically, don’t keep it in the tool.

1 Like

Oh i think i can maybe see what to do i put it inside of workspace and not the tool and keep it welded to the Handle then it would work?

Don’t do anything with having it relate to the tool. Keep the part by itself.

1 Like

Wait but how would i make this then? If theres multiple people with the same tool aka developers

Why would the target need to move?

1 Like