Trying to set a cloned character with no collisions

I’m trying to make an animation with a character, but instead of using viewport frame, i’m using the character in the camera. At first there should be no problem with that, but the character collision is for some reason just doesn’t work at all. I want that the character have NO COLLISIONS, i already tried to disable in the character properties, already tried to use Collision Group, but always the same result.

Here is a video of what is happening:

Here is the script im using:

local module = require(script.Parent.PlayAnimation)

local function SetVFX(Rarity, Character)
	local Attachment = game.ReplicatedStorage.VFX.Epic.Epic:Clone()
	Attachment.Parent = Character.HumanoidRootPart
end

local Characters = {
	"Zun",
	"Spooky",
	"String"
}

while true do
	for _, Character in Characters do
		local Player = game.Players.LocalPlayer
		local Clone = game.ReplicatedStorage.Characters:WaitForChild(Character):Clone()
		local Character = Player.Character
		local Connection
		
		SetVFX("Epic", Clone)
		
		--

		module:PlayAnimation(Clone)
		task.wait()
	end
end

Any ideas on how can i fix that?

3 Likes

I’m sure there’s context of where you’re clearly setting every BasePart’s collision to false… right? I’m asking since I don’t see any of this nature in the code you’ve provided, unless the -- is where that block might be.

1 Like

Didn’t understand too much what you tried to say but, im turning off collisions only by replicated storage right now. I’ve already tried to turn off using scripts but it happened the same way. Something in the character sets the Torso and Head ALWAYS as CanCollide = true, and those are the only parts from the character with actual collision. And those two parts are inside a special collision group.

1 Like

Not me instinctively replacing “character’s parts” with “BaseParts”, lol. Same thing, I was just asking if you’re setting everything that’s a “BasePart” type (meaning Parts, MeshParts, UnionOperation parts, etc. would apply) to false.

I usually don’t have such an issue with character collisions from replicated storage, but maybe there’s a script inside that’s turning on the limb’s collision? That’s really all I can think of, some outside script taking place.

1 Like

Did you tried this?

local module = require(script.Parent.PlayAnimation)

local function SetVFX(Rarity, Character)
	local Attachment = game.ReplicatedStorage.VFX.Epic.Epic:Clone()
	Attachment.Parent = Character.HumanoidRootPart
end

-- Function to disable
local function disableCollision(model)
    for _, child in ipairs(model:GetDescendants()) do
        if child:IsA("BasePart") then
            child.CanCollide = false
        end
    end
end


local Characters = {
	"Zun",
	"Spooky",
	"String"
}

while true do
	for _, Character in Characters do
		local Player = game.Players.LocalPlayer
		local Clone = game.ReplicatedStorage.Characters:WaitForChild(Character):Clone()
		-- Disable 
		disableCollision(Clone)
		local Character = Player.Character
		local Connection
		
		SetVFX("Epic", Clone)
		
		--

		module:PlayAnimation(Clone)
		task.wait()
	end
end
1 Like

This is the default behavior for any Model with a Humanoid instance in it and default character Part names. Humanoid code sets the collidability of all recognized body parts every frame in most of the Humanoid states. Your options are to use humanoid:ChangeState( Enum.HumanoidStateType.Physics ) to set the character to the Physics state before setting all parts CanCollide = false, or to remove the Humanoid if you’re not relying on other Humanoid behavior like the ability to use legacy Pants, and Shirts, for example (Humanoid instance is needed to access the standard avatar clothing texture compositing).

2 Likes

You can always set the collision group.

--!strict

-- Script in ServerScriptService
local PhysicsService = game:GetService("PhysicsService")
local CollisionGroupName: string = "NoCollision"

PhysicsService:RegisterCollisionGroup(CollisionGroupName)
for _, collisionGroupData: {mask: number, name: string} in PhysicsService:GetRegisteredCollisionGroups() do
	if collisionGroupData.name ~= CollisionGroupName then
		PhysicsService:CollisionGroupSetCollidable(CollisionGroupName, collisionGroupData.name, false)
	end
end

-- Somewhere else
for _, child: Instance in model:GetDescendants() do
	if child:IsA("BasePart") == true then
		(child :: BasePart).CollisionGroup = "NoCollision"
	end
end
1 Like

I’ve found the solution.

I we’re using the collision group, but i we’re only using on Torso and Head (the only parts that are usually with collision), but after some tries i discovered that for some reason every part from the character was with collision activated. I set the correct collision group for every single part in the character, and it worked. Thanks for everyone that tried to help me!

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