So, I've already asked this question before, but that was about a week ago, and no responses, but now I have a little more information that might help you help me. So, I'm trying to make a mesh part do damage to anything it touches, but whenever I use the touched event, it makes the mesh part go on top of everything in its way, as if CanCollide was on, but it's not. Without the touched event in there, it works just fine, and the mesh parts just follow the player, but they don't do any damage.

Local:

-- Player Stuff
local player = game.Players.LocalPlayer
local char = player.Character
local humanoid = char:WaitForChild("Humanoid")
local mouse = player:GetMouse()
local UIS = game:GetService("UserInputService")

-- Remote Events
local repStorage = game:GetService("ReplicatedStorage")
local airF = repStorage:WaitForChild("Powers"):WaitForChild("Air")

local main = airF:WaitForChild("Main")

local db1 = false
local db2 = false
local db3 = false

local r1AnimCooldown = 0.75
local r2AnimCooldown = 1

local r1Anim = "rbxassetid://2634163875"
local r2Anim = "rbxassetid://2634201637"
local r3Anim = "rbxassetId://2648818924"

local flyCooldown = 10
local launchCooldown = 5
local tornadoCooldown = 30

UIS.InputBegan:Connect(function(key,playerIsTyping)
	if playerIsTyping == false then
		if key.KeyCode == Enum.KeyCode.R and db1 == false then
			
			local anim1 = Instance.new("Animation")
			local anim2 = Instance.new("Animation")
			local anim3 = Instance.new("Animation")
			
			anim1.AnimationId = r1Anim
			anim2.AnimationId = r2Anim
			anim3.AnimationId = r3Anim
			
			local Anim1 = humanoid:LoadAnimation(anim1)
			local Anim2 = humanoid:LoadAnimation(anim2)
			local Anim3 = humanoid:LoadAnimation(anim3)
			
			Anim1.Priority = Enum.AnimationPriority.Action
			Anim2.Priority = Enum.AnimationPriority.Action
			Anim3.Priority = Enum.AnimationPriority.Action
			
			db1 = true
			main:FireServer(key.KeyCode,mouse.Hit)
			
			Anim1:Play()
			wait(r1AnimCooldown)
			Anim1:Stop()
			
			Anim2:Play()
			wait(r2AnimCooldown)
			Anim2:Stop()
			
			Anim3:Play()
			wait(flyCooldown)
			Anim3:Stop()
			
			db1 = false
			
		elseif key.KeyCode == Enum.KeyCode.T and db2 == false then
			
			db2 = true
			main:FireServer(key.KeyCode,mouse.Hit)
			wait(launchCooldown)
			db2 = false
			
		elseif key.KeyCode == Enum.KeyCode.V and db3 == false then
			
			db3 = true
			main:FireServer(key.KeyCode,mouse.Hit)
			wait(tornadoCooldown)
			db3 = false
			
		end
	end
end)

Server:

-- Replicated Storage
local repStorage = game:GetService("ReplicatedStorage")
local airEvents = repStorage:WaitForChild("Powers"):WaitForChild("Air")
local mainEvent = airEvents:WaitForChild("Main")

local function setY(part,otherPart)
	local yToSet = otherPart.CFrame.Y
	local xToSet = part.CFrame.X
	local zToSet = part.CFrame.Z
	
	part.Position = Vector3.new(xToSet,yToSet,zToSet)
end

-- Event
mainEvent.OnServerEvent:Connect(function(player,key,mouseCFrame)
	-- Character Stuff
	local char = game.Workspace[player.Name]
	local humanoid = char.Humanoid
	local rootPart = char.HumanoidRootPart
	
	-- Getting Meshes
	local airBall = script.AirBall
	local airLaunch = script.AirLaunch
	local ring = script.Ring
	local tornadoPunch = script.TornadoPunch
	local airParticle = script.AirParticle
	
	-- Power Stuff
	local stats = player.Stats
	local power = stats:WaitForChild("Power")
	local powerLevel = power.PowerLevel
	
	if mouseCFrame ~= nil then
		if key == Enum.KeyCode.R then
			
			wait(1.75)
			
			local uno = airLaunch:Clone()
			local dos = airLaunch:Clone()
			
			uno.Parent = game.Workspace
			dos.Parent = game.Workspace
			
			dos.Orientation = Vector3.new(180,0,0)
			uno.Orientation = Vector3.new(0,0,0)
			
			uno.Size = Vector3.new(30,10,30)
			dos.Size = Vector3.new(60,20,60)
			
			local counter = 0
			
			local db = false
			
			local function onTouched(hit)
				local otherHumanoid = hit.Parent.Humanoid
				if otherHumanoid ~= nil then
					if hit.Parent.Name ~= player.Name and db == false and hit.Parent.ClassName == "Model" then
						otherHumanoid:TakeDamage((powerLevel.Value*0.05)*math.random(5,15))
						db = true
						wait(5)
						db = false
					end
				end
			end
			
			while wait(0.01) do
				
				if counter < 10 then
					uno.Orientation = uno.Orientation + Vector3.new(0,40,0)
					dos.Orientation = dos.Orientation + Vector3.new(0,-40,0)
					
					uno.Position = rootPart.CFrame.p
					dos.Position = rootPart.CFrame.p
					
					counter = counter + 0.05
				elseif counter >= 10 then
					counter = 0
					for i = 15,40,5 do
						uno.Size = Vector3.new(i,i/3,i)
						dos.Size = Vector3.new(i*2,(i/3)*2,i*2)
						
						uno.Transparency = i/40
						dos.Transparency = i/40
					end
					break
				end
				uno.Touched:Connect(onTouched)
				dos.Touched:Connect(onTouched)
			end
				
			uno:Destroy()
			dos:Destroy()
			
		elseif key == Enum.KeyCode.T then
-- Won't need anything after this, and even if you did, I couldn't put it in here because it would make the question too long.

I've been working on this one bug for a while now, and I've seen it multiple times, so if you could help me figure it out, I would greatly appreciate it.

4 comments

1

Update the CFrame of the mesh not by the Position property. CFrame ignores collision of other parts. This also replaces using the Orientation property on line 69-70 of the server script.

0

The orientation part is supposed to make it spin, I need the orientation constantly changing. Also, it works just fine whenever I remove the touched event, it just doesn't do any damage.

0

CFrame holds both positional and rotational information, so use CFrame to rotate

0

I get the whats now, but I don't get the hows . . . How would I rotate the parts with CFrame, I'm trying to figure it out on the forums, but I really just can't learn from reading forums. If you know a good tutorial, I would appreciate if you sent me a link to it.