I know the question sounds a little vague so ill explain it fully here: I'm making a fighting game, and in order to do that I need a script where when the player clicks, a hitbox part appears where the player is standing. For some reason, when I run the script while moving, the hitbox always appears behind me instead. Its a small issue, but I really need it fixed to make this game work well. (also if you dont get what i mean, heres a gif showing what im talking about (https://gyazo.com/653233723b164cabb639a7ffde335024))
and heres the script
game.ReplicatedStorage.blahblahblah.OnServerEvent:Connect(function(player,cframe)
local character = player.Character
local hitbox = Instance.new("Part")
hitbox.Size = Vector3.new(4.2, 5.1, 4.1)
hitbox.Color = Color3.fromRGB(255, 0, 0)
hitbox.Transparency = 0.6
hitbox.CanCollide = false
hitbox.Anchored = true
hitbox.CFrame = character.HumanoidRootPart.CFrame
hitbox.Parent = character
end)
also if you're wondering, this is running on a remote event
