#How performance heavy will this be?

1 messages · Page 1 of 1 (latest)

vivid jackal
#

For my hitbox system i use a dot product check for the hitbox, but i was wondering how server intensive this would be since it runs about 20 times per player. I do the dot product for a magnitude hitbox.

#
if Degree then
        print(Degree)
        if horizontalDistance > 2 then
            local forward = rootPart.CFrame.LookVector
            local toTarget = (targetPos - attackerPos).Unit
            local maxAngle = math.rad(Degree)

            if forward:Dot(toTarget) < math.cos(maxAngle) then
                print("Rejected: Target outside front-facing cone (dot: " .. forward:Dot(toTarget) .. ")")
                return false
            end
        end
young bluff
#

Wdym 20 times per player

vivid jackal
young bluff
#

That's fine

#

It's all just math

#

It's more performant than using spatial queries

vivid jackal
#

If that's the case then that's a relief

#

it seems roblox servers are a lot more capable than before

young bluff
#

?

nocturne basinBOT
#

studio** You are now Level 5! **studio

vivid jackal
#

I was concerned because i dont want the hitbox to take the majority of the server's resources

young bluff
#

Try not the worry about the performance of a game too much

vivid jackal
# young bluff ?

I was a tester for a game that used magnitude hitboxes and it was laggy due to the # of calls per frame

young bluff
#

Most definitely another reason