Touched event not firing on mesh

hello! im making a boss fight in my game and 2 of the attacks [which are tentacle attacks which are meshes] are not damaging the player. the damage script works perfectly fine for the other attacks but for these attacks its not working! someone please help!

here is where the attacks are located in the boss fight script :

	local function TentacleSmackAttack(PlayerSelected)
		local Tentacle = game.ReplicatedStorage.BossFightAttacks.TentacleSlam:Clone()
		game:GetService('RunService').Stepped:Wait()
		CanAttack = false
		Tentacle.Parent = workspace
		Tentacle.Tentacle.Orientation = PlayerSelected.Character.Head.Orientation
		game:GetService("TweenService"):Create(Tentacle.Tentacle, TweenInfo.new(2), {Position = Tentacle.TentacleAppearPos.Position}):Play()
		wait(2.1)
		local Anim = Tentacle.AnimationController.Animator:LoadAnimation(script.SlamAnim)
		Anim:Play()
		Anim.Ended:Wait()
		print("Attack Finished")
		wait(1)
		game:GetService("TweenService"):Create(Tentacle.Tentacle, TweenInfo.new(1), {Position = Tentacle.TentacleDissapearPos.Position}):Play()
		wait(1.1)
		CanAttack = true
		Tentacle:Destroy()
	end

	local function TentacleSpinAttack(PlayerSelected)
		local Tentacle = game.ReplicatedStorage.BossFightAttacks.TentacleSpin:Clone()
		game:GetService('RunService').Stepped:Wait()
		CanAttack = false
		Tentacle.Parent = workspace
		Tentacle.Tentacle.CFrame = Tentacle.Tentacle.CFrame * rotation
		game:GetService("TweenService"):Create(Tentacle.Tentacle, TweenInfo.new(2), {Position = Tentacle.TentacleAppearPos.Position}):Play()
		wait(2.1)
		local Anim = Tentacle.AnimationController.Animator:LoadAnimation(script.SpinAnim)
		Anim:Play()
		Anim.Ended:Wait()
		print("Attack Finished")
		wait(1)
		game:GetService("TweenService"):Create(Tentacle.Tentacle, TweenInfo.new(1), {Position = Tentacle.TentacleDissapearPos.Position}):Play()
		wait(1.1)
		CanAttack = true
		Tentacle:Destroy()
	end

if someone can help me i will be really happy! also i think its not playing cuz of the animation the tentacles play… but im not sure!

3 Likes

Hmm… Maybe you could try to attach an invisible hitbox to the tentacle to detect collisions and weld it to the tentacle.

but will it play with the animation?

Yes, this is probably a good solution to the problem by working around the hitboxes of the original mesh since meshes in Roblox don’t always have perfect hitboxes calculations.

Instead of welding it, you can make it animatable and Motor6D it to the tentacle. It should sync up with the tentacle and you probably won’t have to make many changes to the animation for it to properly again with the new hitboxes.

Though this is probably not the most efficient way to solve this…

Okay, well then, I’m not sure what you should do.

ok. ill try this method first. and if it doesnt work then i will try the other one

oh yeah. i forgot i rigged it in blender. idk how i will constraint the hitbox now.

… yup that now makes me stumped.

same. kinda losing motivation.

i might just remake the tentacle and just see if it works from there

yeah, but we’ll see soon though.

The collision of meshes is rather complex. Roblox uses Approximate Convex Decomposition. As the name suggests it uses convex shapes to generate a hitbox which does not represent the hitbox 1:1. It‘s also very inefficient. You should probably parent a Part to the Mesh. The hitbox will not represent the mesh at all but as long as it‘s just a boss fight and the hitbox does not have to be 100% exact, this is a way better solution.

This immediately brings you to the collision of meshes.

i would try this but i am doing it another way. which im still testing…

yep i just had to remake the tentacle using roblox cylinders.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.