Collision Somehow happens when the object is created on the client on a nonCollidiable group (With a object thatexists in the server)

I made a code that creates clones of your character

The issue is that somehow the DUMMY? collides (This is a local script and has a collisionGroup) the player itself cannot collide with it like it should but the dummy somehow does

Code:

event.OnClientEvent:Connect(function(character,Length,Effect,TurnOff)


	if Effect then
	StartTime = time()
	SandevistanEnabled = true



Connection =	rus.RenderStepped:Connect(function(dt)

			if character:GetAttribute("State") ~= "Ability" and character:GetAttribute("State") ~= "Idle" and character:GetAttribute("State") ~= "Cutscene" then return end
		if SandevistanEnabled == false then return end		
		
		
			if time()-StartTime > Length then
				Connection:Disconnect()
				return
			end
		
		if LastTime then
			if time()-LastTime < 0.1 then
			
				
				
				return end
		end



			character.Archivable = true
			local characterClone = character:Clone()

			local highlight = script.ColorEffect:Clone()


		debris:AddItem(characterClone,2)

		debris:AddItem(highlight,1.9)
		highlight.Parent = characterClone
		local hue = tick() % Length / Length
		local color = Color3.fromHSV(hue, 1, 1)
		highlight.FillColor = color
		ts:Create(highlight,effectInfo,HighlighteffectGoal):Play()
			character.Archivable = false

		for i,v in characterClone:GetChildren()  do
			if v:IsA("BasePart") then
				v.CollisionGroup = "Clone"
				v.CanCollide = false	
				v.Anchored = true
				v.CastShadow = false
			
				ts:Create(v,effectInfo,effectGoal):Play()
				
	if v.Name == "HumanoidRootPart" then
		v:Destroy()
	end

				if v.Name == "Head" then
					for i,x in v:GetChildren() do
						if x:IsA("Decal") then
							ts:Create(x,effectInfo,effectGoal):Play()
						end
					end
				end

			end
			
				if v:IsA("Accessory") then
					ts:Create(v:FindFirstChild("Handle"),effectInfo,effectGoal):Play()

				end
			if v:IsA("Script") then
				v:Destroy()
				
			end
			
			
			if v:IsA("Folder") then
				v:Destroy()
			end
		end

		characterClone.Parent = workspace

		LastTime= time()



	end)

	else
		
		if TurnOff then
			lighting.sandevistan.Enabled = false
			return
		end
		
		if lighting.sandevistan.Enabled  then
			
			IgnoreOld = true
			
		end
		FadeIn:Play()
		lighting.sandevistan.Enabled = true
		
		task.delay(Length,function()
			
			
			if IgnoreOld then 
				IgnoreOld = false
				return
			end
			
			FadeOut:Play()
			task.delay(0.3,function()
			lighting.sandevistan.Enabled = false
			end)
			
		end)
		
		
		
		
	end



end)
1 Like

try using GetDescendants() to turn off the models collision.

that dosent make sense… ? it dosent collide with the player even tho the part is created from the client its somehow collides with the dummy

by collide do you mean the fact that the player is getting pushed when the animation happens? not really sure what is and isnt a part of the animation

if you wanna test if the collision group is working, turn on TouchedUsesCollisionGroup which is a property of workspace and connect a touched event to the dummy to see if it really is colliding

i know touched and collide are different but this will tell you if the group is functioning. (which im certain it is if you set it up right)

Wait wait wait i think i see the error lol. in your for loop you have your variables as “i, v” but you only loop through charClone:GetChildren() which only passes one variable.

try changing to pairs(charClone:GetChildren())

the dummy is when i used it without the dummy it works fine

yeah im new to roblox dev so it might be the problem ill check

aded the pairs() didnt change anything

can you show me the updated for loop?

I got a fix for it maybe its not the best way to do it but i just anchored one of the players

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