#How to make a moving part touch another part?

13 messages · Page 1 of 1 (latest)

lapis lodge
#

So I'm making a space invaders like game and I'm trying to make it so when the laser touches the alien it will destroy both of them. But for some reason my moving part isn't making it happen, it only destroys the alien when it stops moving and is unanchored.

slow nimbus
#

post the script please

lapis lodge
#
            print("Shot fired!")
            Laser.Parent = workspace
            Laser.Anchored = true
            Laser.Position = Vector3.new(MainLocation.X, MainLocation.Y+3, MainLocation.Z)
            for i = 1,20 do
                Laser.Position += Vector3.new(false, 3, false)
                wait(0.3)
            end
            Laser.Touched:Connect(function(hit)
                hit:Destroy()
                Laser:Destroy()
            end)
            wait(1)
lapis lodge
#

hello

slow nimbus
#

Change it to “local Laser = workspace.Laser” and then “local Laserclone = Laser:Clone()

#

Change the three lines that state properties of the laser to “laserclone”

#

Finally “laserclone:destroy()

#

Hopefully this works

#
local LaserClone = Laser:Clone( )
            print("Shot fired!")
            LaserClone.Parent = workspace
            LaserClone.Anchored = true
            LaserClone.Position = Vector3.new(MainLocation.X, MainLocation.Y+3, MainLocation.Z)
            for i = 1,20 do
                LaserClone.Position += Vector3.new(false, 3, false)
                wait(0.3)
            end
            Laser.Touched:Connect(function(hit)
                hit:Destroy()
                LaserClone:Destroy()
            end)
            wait(1)
#

This might work

#

I can’t test it because I’m on mobile rn

lapis lodge
#

So sorry but this didn't really work

slow nimbus
#

It’s ok