Iam having some collisions problems with my skill (read the post to understand please)

Bassicaly the skill create a sphere that trap players (caster Will be traped too but he Will have advantage inside)

But have some problems, the problem is the collision issue, I don’t want the sphere to enter any building, mountain or into another sphere, I tried to use cancollide but it’s not possible to use cancolide and anchored together (if I don’t use anchored the sphere will fall …), so I need a way for the sphere to appear in a place with enough space

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DarkZone = ReplicatedStorage.Skills.Impure.DarkZone.Remotes.DarkZone
local Meshes = script.Meshes
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local trainingm = require(game.ServerStorage.TrainingFiles.TrainingModule)
local function darkZoneF(player)
    local interval = 0	
	local usingSkill = Instance.new("BoolValue")
	local colission = false
	usingSkill.Name = "usingSkill"
	usingSkill.Value = true
	usingSkill.Parent = player
	print("DARK ZONE")
	local Character = player.Character
	local Humanoid = Character:WaitForChild("Humanoid")
	local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
	local b = Instance.new("BodyPosition")
	local bv = Instance.new("BodyVelocity")
	local Track = Humanoid:LoadAnimation(script.DZone1)
	local ValueA = Track.Length
	local Folder = Instance.new("Folder",workspace)
	Folder.Name = player.Name.." DZone"
	Folder.Parent = workspace
	local mDark = Meshes:WaitForChild("MDarkZone"):Clone()
	mDark.CFrame = Character:WaitForChild("LeftHand").CFrame * CFrame.new(0.8,0,-0.1)
	mDark.Parent = Folder
	mDark.Touched:Connect(function(hit) end)
	local weld = Instance.new("WeldConstraint")
	weld.Parent = Folder
	weld.Part0 = mDark
	weld.Part1 = Character:WaitForChild("LeftHand")
	local goal = {}
	goal.Transparency = mDark.Transparency - 1
	local info = TweenInfo.new(0.2)   
	local tween = TweenService:Create(mDark,info,goal)
	local Track = Humanoid:LoadAnimation(script.DZone2)
	HumanoidRP.Anchored = false
	local goal = {}
	goal.Size = mDark.Size + Vector3.new(128, 128, 128)
	goal.CFrame = mDark.CFrame + Vector3.new(0,128,0)
	local info = TweenInfo.new(0.2)   
	local tween = TweenService:Create(mDark,info,goal)
	mDark.CanCollide = true

	 while mDark.Parent do
		  local amount = 0
		  for _, part in ipairs(mDark:GetTouchingParts()) do
			 amount = amount + 1
		  if amount == 0 then
			print("NOT TOUCHING")
			HumanoidRP.CFrame = mDark.CFrame
			mDark.Anchored = true
			mDark.Anchored = false
			interval = 0
		 interval = interval + 1
		 if interval > 3 then

local function checkEnable(player)
	if trainingm.GetTraining(player)["Endurance"] ~= "No" or trainingm.GetTraining(player)["Mind"] == "Auto" or player:FindFirstChild("usingSkill") then
		player.Character:WaitForChild("HumanoidRootPart").Anchored = true


I tried make that while to anchor the part when part stop touching, but this made the skill very ulgy when appear, see

**I don’t know if you noticed it but it appears inside the other sphere and only after it leaves it, it gets very ugly and can bug (sometimes it goes into the sphere), I want to avoid that: **


Have you looking into Collision Filtering via Collision Groups? You can choose what and what not to collide with.

FYI: If you wanted to ignore the Roblox terrain then you should add workspace.Terrain to the CollisionGroup that you’ll set the collisions off to.

1 Like

?? this is contrary to what I want, I simply want the sphere to appear somewhere with nothing to prevent the sphere from getting stuck inside something (like another sphere for example)

You’re trying to make it not collide with the buildings, mountains or other spheres? Or am I getting the wrong end of the stick?

I just want the sphere not to get stuck in anything, it must appear in a place with enough space for it

1 Like

I’m sure you can turn on both Anchor and CanCollide at the same time, I mean theres no reason to why it wouldn’t work like that.

I suggest you try reducing the size of the spheres so you can see better what they are colliding with.

Why don’t you check the region3 first after placing down the sphere and check if smth is inside? (Terrain or parts).

Check this is okay but how i will know where the part should be placed ?

I would make it in a loop and check your surroundings and if it hitting something, move +50 on the x or y or z axes.

Please do not create duplicate topics