I have a space-invader like game, when a part goes though another (both CFramed) The enemy gets killed (:Destroy())
-- Basic Script I am using script.Parent.Touched:connect(function() script.Parent:Destory() end)
I was informed somewhere that :Touched event doesn't work with parts being CFramed, in my case both parts are
I dont really know how to do that, but I would recommend simply using a part to do the .Touched event. To do that you can use a script like this:
local Part = Instance.new("Part", workspace) Part.Size = Vector3.new(0.1,0.1,0.1) Part.Shape = ("Ball") Part.Position = Vector3.new(-3.5,0.5,4.5) Part.CFrame = tool.Handle.CFrame Part.CFrame = CFrame.new(Part.Position,mouse.Hit.p) local v = Instance.new("BodyVelocity", Part) v.velocity = Part.CFrame.lookVector *90 v.maxForce = Vector3.new(math.huge, math.huge, math.huge)
Of course, I am also new to scripting so dont expect much from me. I hope this helped.