Help Moving a humanoid NEXT to a other humanoid

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? having Miss.Lemon next to MrLemon

image

yes this is a “Raise a floppa” inspired game

  1. What solutions have you tried so far? : Vector3, CFrames, etc

Please help me with this

3 Likes

Please share the code you used to try this.

local Lemon = script.Parent
local Husband = workspace.Lemon.HumanoidRootPart

local Humanoid = script.Parent.Humanoid

while true do
wait(0.1)
Humanoid:MoveTo(Husband.Position * Vector3.new(1,0,1))
end

wait nvm its deffo not working now

why it not work now
it worked for like 1 sec
:sad:

You could do a distance check to stop the lemon from moving once it’s within proximity of the other lemon:

local Lemon = script.Parent
local Husband = workspace.Lemon.HumanoidRootPart

local Humanoid = script.Parent.Humanoid

local MIN_DIST = 10 --//How close the lemon can get to the husband lemon

local function distToHusband()
return (Lemon.HumanoidRootPart.Position - Husband.HumanoidRootPart.Position).Magnitude
end

while true do
wait(0.1)

if distToHusband() > MIN_DIST then
Humanoid:MoveTo(Husband.Position)
else
Humanoid:MoveTo(Lemon.HumanoidRootPart.Position)
end

but i would like Lemon2 to stay Next to Lemon1
not in proximity of lemon1

local targetPos = (Husband.CFrame * CFrame.new(0, 0, -1.5)).Position --//modify this offset

--//move lemon to targetPos

omg it works thank you so much!

1 Like