Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i fix the explosion position?

usi = game:GetService("UserInputService")
plr = game.Players.LocalPlayer
char = plr.Character
debris = game:GetService("Debris")

usi.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.X then
		animation = Instance.new("Animation")
		animation.AnimationId = "rbxassetid://7050119585"
		animation.Parent = plr
                debris:AddItem(animation,2)
		
		load = game.Workspace[game.Players.LocalPlayer.Name].Humanoid:LoadAnimation(animation):Play()
		
		wait(.15)
		
		
		explosion = Instance.new("Explosion")
		explosion.Parent = workspace
		explosion.DestroyJointRadiusPercent = 0
		explosion.Position = game.Players.LocalPlayer.Character.RightHand.Position + (Vector3.new(50,0,0) * game.Players.LocalPlayer.Character.RightHand.CFrame.LookVector)
	end

end)

Im trying to make a explosion appear in front of player's hand when he press x. But almost everytime the explosion goes another way (i dont think this problem is because of the animation).

1 answer

ok i fixed it : explosion.Position = plr.Character.HumanoidRootPart.Position + (plr.Character.HumanoidRootPart.CFrame.LookVector*Vector3.new(10,10,10))

This discussion is preserved as it was. New answers, comments, and votes are closed.