When i add part in front of player and weld it, it teleports the player to the part instead of just having it in front of the player

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Make part appear in front of player and weld it
  2. What is the issue? Include screenshots / videos if possible!
    it teleport the player to the part
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    u have tried switching up parts and adding waits but no avail
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local player = tool.Parent
	local hum = player:FindFirstChild("Humanoid")
	local range = game.ServerStorage.Random.GBhitr
	print("Get into it yuh")
	local slice = hum:LoadAnimation(amm2)
	
	slice:Play()
	local cpy = range:Clone() 
	local offset = Vector3.new(0 ,0 ,-5 )
	local hrp = player.PrimaryPart
	cpy.CFrame = hrp.CFrame * CFrame.new(offset)
	cpy.Parent = player
	
	local weld = Instance.new("Weld", player)
	weld.Part0 = player.PrimaryPart
	weld.Part1 = cpy
	

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

3 Likes

Try swapping Part0 with Part1. (Part0 becomes cpy and Part1 player.PrimaryPart)
Also you should parent the weld to Part0. I’m pretty sure it changes the behavior.

2 Likes

so parent and part 0 should be cpy?

Yes. Try changing it like that.

local player = tool.Parent
	local hum = player:FindFirstChild("Humanoid")
	local range = game.ServerStorage.Random.GBhitr
	
	print("Get into it yuh")
	local slice = hum:LoadAnimation(amm2)
	
	slice:Play()
	local cpy = range:Clone() 
	local hrp = player.PrimaryPart
	local offset = Vector3.new(0, 0, -5)
	cpy.CFrame = hrp.CFrame*CFrame.new(offset)
	cpy.Parent = player
	
	local weld = Instance.new("Weld", cpy)
	
	weld.Part0 = cpy
	weld.Part1 = player.PrimaryPart

tried this but still not working

Hmm. Is the part “cpy” anchored? If it’s anchored it does not move which results in the player getting teleported to the part instead of the opposite.

Try making sure the part is unanchored.

1 Like

yeah it is unanchored and can collide is false

Try using a WeldConstraint instead of a Weld.

3 Likes

YES! that was the one. it finally workedddddd

Can you try changing the last 3 lines to this:

local weld = Instance.new("Weld")
weld.Part0 = cpy
weld.Part1 = player.PrimaryPart
weld.Parent = cpy

edit: nevermind already solved

1 Like