Make a part move the other way while following something?

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

  1. What do you want to achieve? So i want to make a part moves the other way while following a part

  2. What is the issue? I have no idea how.

  3. What solutions have you tried so far? So i have a script that makes the part follows the other part (setting the part cframe to the other parts cframe) (looped)

I tried tween service but it doesnt do the trick

and i have no other idea how am i going to do it

local function doLoop()
      task.wait()

      part.CFrame = CFrame.new(otherPart.CFrame)
      doLoop()
end

doLoop()
2 Likes

Can you elaborate? What do you mean by “moves the other way”? Which way does it actually move?

Cframe:LookAt(-part1.Position,-part2.Position)

I meant by that is-

O = Main Part
D = Other Part

So the Other Part moves this way

D →

While the Main Part follows the Other Part

O →

(Moving the same direction as the Other Part since its following it after all / following the Other Part)

But i wanna make it move another direction like

← O

while still following the Other Part

so like

I wanna make the Main Part follow the Other Part, WHILE having the Main Part move on a different direction

like two different movements at the same time? if thats even possible

O
→ (First movement, Main Part’s CFrame is set to the Other Parts Position)
← (Second Movement, Main Part’s CFrame is slowly moving to another direction)

Is this what you meant?

part.CFrame = CFrame.new(Vector3.new(-otherPart.Position.X,otherPart.Position.Y,-otherPart.Position.Z))

Well kind of,

So this “Other Part” is moving

→ (Well it could be any direction x/ y/ z so i represent it with an arrow)

And i have this “Main Part” that follows the “Other Part” by making a loop that sets the CFrame of the “Main Part” around the same Position of the “Other Part”

So 1st movement is done, Main Part follows the Other Part

But i wanna make the Main Part do another movement as well

← O (Slowly or any speed at all tbh)

I tried tweenServ, and lets say it doesnt achieve the effect i wanted to and i dont really have any idea at all how am i going to implement it

I’m still confused. Perhaps you can show me an example?

alright wait

30 - CharsssSAsas

So did you get an example? It’s been 13 minutes.

Nopeee, ill show an example in a bit, my internet be slow rn

Okay here

So the 1st Movement here is setting that huge parts CFrame to HumanoidRootPart’s Position

And the 2nd Movement im trying to achieve is when i moved that huge part manually

Now I think i get what you mean.

local movement2 = false

task.spawn(function()
    while movement2 do
       task.wait()
       Part.CFrame = CFrame.new(
           Vector3.new(
                -otherPart.Position.X,
                otherPart.Position.Y,
                -otherPart.Position.Z
           )
        )
    end
end)
task.wait(5)
movement2 = true