BoltNetwork.OverlapSphereAll not behaving as expected

Hi Team, i need some help, i am struggling to find good resources on how to use the BoltNetwork.OverlapSphereAll call, i have used the RaycastAll method perfectly for shooting however the scenario here is a grenade:

My implementation;

Player clicks mouse

I spawn a BoltNetwork object that has its own entity

i apply force to the object until it reaches its targeted destination

once i reach the targeted destination, i stop the object completely and i call a method with the below body once:
if (entity.IsOwner)
using (var hits = BoltNetwork.OverlapSphereAll(transform.position, 30f, BoltNetwork.ServerFrame))
for (int i = 0; i < hits.count; i++)
var hit = hits.GetHit(i);
var targetEntity = hit.body.GetComponent<BoltEntity>();

The debug inside the body code does not hit anything (hits.count always 0), even after confirming in the inspector window that 2 of the above objects are touching, or even if a player is in proximity when i call the code above, it doesnt detect any other hitboxes that it overlaps

When i call the above method anything that is a BoltHitbox that is touching the sphere hitbox will register, and successfully populate hits.count

Hope i have detailed my scenario here enough

Best Answer


  • edited March 15
    I have sort of answered my question, the code above does work however there was a correction to be made on this line of code:

    using (var hits = BoltNetwork.OverlapSphereAll(transform.position, 30f, BoltNetwork.ServerFrame))

    instead of BoltNetwork.ServerFrame i had to use the Playercommand.ServerFrame (which comes from the player command

    Which does confuse things for me,

    The Playercommand.ServerFrame is when i initiated this button click, its take time for the grenade to reach its target, therefore my thinking was i would use the frame (latest server frame at this point) at the moment of the grenade exploding(not its init frame) instead of the Server frame of my player command

  • You are correct this did help my situation, which makes sense with my second solution where i delayed the explosion by a second before using the Boltnetwork.ServerFrame which seemed to give Bolt enough time to register the frame, Many thanks
Sign In or Register to comment.