Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

When I change just the x value with the vector 3 the part randomly is placed higher ?

Asked by 5 years ago
local module = {}

NPCs = script.Parent:WaitForChild("Aliens")
End = script.Parent:WaitForChild("EndPart")
Sweeper = script.Parent:WaitForChild("Sweeper")

function module.mainActivate()
 if NPCs and End then
local move = coroutine.wrap(function()
  while true do
   wait()
   Sweeper.Position = Sweeper.Position + Vector3.new(1,0,0)
   NPCs.Alien1.Humanoid:MoveTo(End.Position)
   NPCs.Alien2.Humanoid:MoveTo(End.Position)
   NPCs.Alien3.Humanoid:MoveTo(End.Position)
   NPCs.Alien4.Humanoid:MoveTo(End.Position)
   NPCs.Alien5.Humanoid:MoveTo(End.Position)
   NPCs.Alien6.Humanoid:MoveTo(End.Position)
   NPCs.Alien7.Humanoid:MoveTo(End.Position)
   NPCs.Alien8.Humanoid:MoveTo(End.Position)
  end
 end)
 move()
  end
end

return module

0
Could you give more detail as to what you are asking please? chomboghai 2044 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

What might be happening is when you use Vector3 for Position, if the part collides with another part, it will default to being above it instead of partially colliding with it. Try using Sweeper.CFrame = Sweeper.CFrame * CFrame.new(1,0,0)

0
it works but moves on the z-axis instead of the x-axis jakebball2014 84 — 5y
Ad

Answer this question