Weird game error

(This is my first post ever so it may be bad but whatever)

Bascially when I throw my snowballs when I spawn, it works fine, but once I am teleported to the map the snowballs destroy right away it is strange, here is the video link, - YouTube

Is there anyway I can fix this? I can not cointinue my game development because of this error.

2 Likes

For starters, lets try printing what it collides with, which in your case would be:

if hit then
  print(hit.Name, hit.Parent.Name, hit.ClassName)
end

I just noticed you are calling :Destroy() on your tool
image

ok. thank you. should i remove that?

Give it a shot and see what happens for now

Ok, so it is constantly printing my character’s name, I also removed the tool:destroy part, but it still disappears. But for some reason it works when I throw it in the lobby.

Mind sending your code here? I’ll take a look

game.ReplicatedStorage.Throw.OnServerEvent:Connect(function(player,mousepos,tool,handle)

handle.Parent = game.Workspace


handle.AssemblyLinearVelocity = mousepos.lookVector * handle.Speed.Value * 15 + Vector3.new(0,50,0)



handle.Touched:Connect(function(hit)
	if hit then
		print(hit.Name, hit.Parent.Name, hit.ClassName)
	end
	if hit.Parent.Name ~= player.Name and not hit.Parent:IsA("Accessory") then
	
			
			handle:Destroy()
			
			hit.Parent.Humanoid:TakeDamage(25)
			tool:Destroy()
	
		end

		
		
end)

end)

client side script:

local mouse = game.Players.LocalPlayer:GetMouse()
local current = nil
local debounce = false

script.Parent.Activated:Connect(function()
if not debounce then

	local animator = script.Parent.Parent.Humanoid:WaitForChild("Animator")
	
	current = animator:LoadAnimation(script.Parent.Throw)
	debounce = true
	current:Play()
	wait(0.25)
	game.ReplicatedStorage.Throw:FireServer(mouse.Hit,script.Parent,script.Parent.Handle)

	


	wait(5)
	debounce = false
end

end)

it didnt format well sadly, i tried

Replace this with

if hit.Parent.Name == Player.Name then print("Same Player") return end
if hit.Parent:IsA("Accessory") then print("Accessory") return end

hit.Parent.Humanoid:TakeDamage(25)
task.wait()

handle:Destroy()
tool:Destroy()

and then send me the output

ok so it printed “Same Player” but heres the thing, when I throw it, it becomes invisible, the transparency does not change, but it is still in the workspace, but not visible, it is really strange

in the lobby it works perfectly fine, but it is after i get teleported

Do you have any other scripts that might be clashing with it? If not, try setting the snowballs CanCollide to true

it already is true, maybe ill make it false and see what happens

dang didnt work sadly idk what to do maybe theres something with the map

@novus for some reason I feel like it is related to the teleporting of the character, because sometimes when i throw it, it prints “Island”
(lobby) so maybe it is not calculating, the teleporting part is in a script not a local script

Anyways i have to go ill see if i can fix it tomorrow

I fixed the error, I used :SetPrimaryPartCFrame instead of just setting the characters position and it worked!