How do I make a model constantly spawn at a certain point?

I have been trying to make my model, (A car) spawn constantly at a certain point every few seconds, but everything I have tried hasn’t worked. I have already looked through the dev forums, and I can’t find exactly what I’m looking for. Any help would be greatly appreciated! :grinning:

Here’s my code for reference:

1 Like

You’ll want to set its position rather than using CFrames

1 Like

What should I use for that? Or should I just put the coords by themselves?

1 Like

You can add in an invisible part for where you want to position the model then just:

Model:SetPrimaryPartCFrame(InvisiblePart.CFrame * CFrame.new(0, Model:GetExtentsSize().Y / 2, 0))
1 Like

Do I put the spawners coords in here?

No no. It will do it for you with that InvisiblePart.CFrame

I’m trying to run it but it’s not spawning and there are no errors with the script. Maybe it’s something wrong with my place

Here’s an updated picture of you need it:

You’re cloning the car and then parenting it to the cloned car, you probably want to parent the clone to the workspace container.

For SetPrimaryPartCFrame() to work the car model must have its PrimaryPart property assigned some value (in this case a BasePart value instance belonging to the model).

How do I figure out the value of the base part?

image

What does this look like for the red car model?

1 Like

It’s blank.

Okay, so instead of SetPrimaryPartCFrame() use PivotTo() as the latter doesn’t require that the model has its PrimaryPart property set.

https://developer.roblox.com/en-us/api-reference/function/PVInstance/PivotTo

Alright, the teleporting is working. :smile: But now when I run it, the car I currently have down teleports to the part that is the spawner, and no more spawn.

Video for reference:

What does the current script look like?

That script should be cloning the red car every 3 seconds and then moving it to above the car spawner.

Make sure the original red car still exists when it is being cloned.

Doesn’t the clone function make it do that? Or is it teleporting only the original

Instead of RedCar:PivotTo() do copy:PivotTo().

There are tons of red cars popping up in the workspace now, but I can’t see them or they are not in the right place.

(Sorry for all the trouble!!!)