i have this intentionally anchored model that i am moving using positing
it will move to the mouse3position and stop when it reaches there
for the most part i got things down except for stopping it
i cant get my head around checking vector3s so i gave that up
magnitude doesnt help since i dont have experience with that
i tried touched event but it cant detect model that is using positioning to move
the solution that i am trying to make it work right now is have a part positioned to the mouse3position
and when the model touches that part it will fire a signal telling the model to stop moving
this is the script im using
local Tower = workspace.Conscript
local RemoteEvent = game:GetService("ReplicatedStorage").C
RemoteEvent.OnServerEvent:Connect(function(Player, Mouse3Position)
workspace.Part.Position = Mouse3Position
local MouseXValue = Mouse3Position.X
local MouseZValue = Mouse3Position.Z
local PrimaryPartPosition = Tower.PrimaryPart.Position
Tower:SetPrimaryPartCFrame(CFrame.new(PrimaryPartPosition, Vector3.new(MouseXValue, PrimaryPartPosition.Y, MouseZValue)))
--the above is a set up to set things up in the right place
while --[[if model not touched part]] do
--moves model in the direction i want
Tower:SetPrimaryPartCFrame(Tower.PrimaryPart.CFrame + Tower.PrimaryPart.CFrame.LookVector*1)
wait()
end
end)
, well then perhaps try using a touched event: