So I'm trying to make a basic special attack where the first part of it spawns a hitbox infront of the players body when an animation marker is reached, to test if the hitbox was created accurately I made it so autorotate turns off when the hitbox spawns. Now if I do my move while not rotating it correctly spawns the hitbox infront of my body as seen in the first pic but if I'm rotating my camera around while trying to use it, I get locked in place by the autorotate in an orientation that doesnt match with the hitbox orientation, in the 2nd pic you can see im basically facing away from the hitbox , I thought a function like this where autorotate is set to false at the same time that the hitbox is created should always have the player orientation match with the hitbox creation no matter what, so how is it possible that this happens?
SkillAnimation:GetMarkerReachedSignal("Hit1"):connect(function()
local Hitbox = HitboxModule.CreateHitbox()
Hitbox.Size = Vector3.new(4, 4, 4)
Hitbox.Offset = CFrame.new(0, 0, -3)
Hitbox.Shape = "Box"
Hitbox.Char = Character
Hitbox.Visualizer = true
local HitService = HitServiceModule.new()
HitService.PlayerChar = Character
Hitbox.CFrame = hrp.CFrame
print("Hit1")
local HumsHit = Hitbox:Cast()
Character.Humanoid.AutoRotate = false
if #HumsHit == 0 then
task.delay(0.2, function()
SkillAnimation:Stop()
task.delay(2, function()
Character.Humanoid.AutoRotate = true
end)
end)
return
end