Cannot place player in sphere

local sphere = game.Workspace.Sphere
local clickDetect = script.Parent.ClickDetector

clickDetect.MouseClick:Connect(function(player)
	
	local part = Instance.new("Part")
	part.Position = Vector3.new(sphere.Position.X,sphere.Position.Y,sphere.Position.Z)
	part.Size = sphere.Size
	part.Color = Color3.new(1, 0.564706, 0.0627451)
	part.Parent = game.Workspace
	part.Transparency = 0.6
	part.Anchored = true
	part.Shape = sphere.Shape
	part.CanCollide = false
	
	task.wait(1)
	
	player.Character.PrimaryPart.Position = Vector3.new(part.Position.X,part.Position.Y,part.Position.Z)
	part.Anchored = false
	part.CanCollide = true
	
	
end)

The code above should create a sphere when clicked. The player should teleport IN the sphere.

The player gets pushed out and I am trying to find a way for the player to stay put in the sphere.

roblox built-in default spheres don’t have those sort of holes for average character sizes to fit in so it pushes them out instead, you can fix this if you use a different type of mesh part

What I’m trying to do is to turn of collisions for the sphere so the player can get in. I am looking for a way to make the player freeze in the sphere so it does not get pushed out.

you need to use a weld constraint so the player is glued to the sphere and disable their core animations (optionally)

Something happend, but…

I am not supposed to control it, anyway I can fix this?

Current code:

local sphere = game.Workspace.Sphere
local clickDetect = script.Parent.ClickDetector

clickDetect.MouseClick:Connect(function(player)
	
	local weild = Instance.new("WeldConstraint")
	local part = Instance.new("Part")
	part.Position = Vector3.new(sphere.Position.X,sphere.Position.Y,sphere.Position.Z)
	part.Size = sphere.Size
	part.Color = Color3.new(1, 0.564706, 0.0627451)
	part.Parent = game.Workspace
	part.Transparency = 0.6
	part.Anchored = true
	part.Shape = sphere.Shape
	part.CanCollide = false
	
	task.wait(1)
	
	weild.Parent = player.Character.PrimaryPart
	weild.Part0 = part
	weild.Part1 = player.Character.PrimaryPart
	weild.Enabled = true
	
	player.Character.PrimaryPart.Position = Vector3.new(part.Position.X,part.Position.Y,part.Position.Z)
	
	task.wait(1)
	
	part.Anchored = false
	part.CanCollide = true
	
	
end)

humanoid1.PlatformStand = true

2 Likes

Yes, now it works. Thx!