I would put my code here but i dont even know where to start with this, but basically, say model/part A is the animal if model B is within say 50 studs of it, model A moves over to model B. I have looked through the wiki for help but i couldn't find anything. Edit: Preferably smooth movement.
COMMUNITY QUESTION
Is there any way to make a model go to another model if it is within a certain range of it?
1 answer
You would just have to get the magnitude of both model's positions.
if (model1.PrimaryPart.Position - model2.PrimaryPart.Position).magnitude <= 20 then
model1:MoveTo(model2.PrimaryPart.Position)
end
Not very hard, but most people don't know about magnitude. Hope I helped!
Function.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You didn't specify how you wanted the teleport to be. Instantaneous, or smooth? I see Function assumed you wanted instantaneous movement. More context!