You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to achieve the marker fully going to the Marker spawn
What is the issue? Include screenshots / videos if possible!
The issue is that the marker isn’t fully going to It’s spawn
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I haven’t tried any solutions on the Dev Hub
Here is the Code
local ss = game:GetService("ServerStorage")
local mf = ss:WaitForChild("Markers"):GetChildren()
local rm = mf[math.random(#mf)]:Clone()
local sp = workspace:FindFirstChild("MarkerSpawns")
if not sp then
print("Spawns not found")
end
local asp = sp:GetChildren()
local rasp = asp[math.random(#asp)]
local Model = game:GetService("Workspace")["Cat Marker"]
local Center = Model.Center;
wait(1)
Model:MoveTo(Vector3.new(rasp))
You’re not giving 3 number as Vector3.new expects, so the model is moving to 0, 0, 0.
Also, MoveTo() doesn’t allow you to collide with objects, so I’d instead use PivotTo() which doesn’t get affected by this and can also move models to the desired position.
Model:PivotTo(rasp.CFrame)
math.random can also be used with only one value and will automatically set the minimum value to 1.