Summary
- Use the abstract class
debug_draw_channel for debug_draw:Channel
- Use the debug draw to draw something
Please select what you are reporting on:
Creative
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
If you use the abstract class debug_draw_channel for debug_draw:Channel it will compile just fine, but on a draw call it will stall the game.
Expected Result
Compile time error, or pre-compile error
Observed Result
Stalls execution at runtime
Platform(s)
All
wait, it might be something else…
Weirdly this works, like this, in an asynchronous context. However it did not work in an immediate context. It does work in immediate contexts without using debug draw.
Here’s the code where it works (async context), removing the sleeps and making function immediate will crash without anything printing
PickUpBrainrotAsync(Agent: agent, GB: grid_brainrot_component)<suspends>:void=
if:
Player := player[Agent]
not HeldBrainrotByPlayer[Player]
not HeldByPlayer[Player]
FC := Player.GetFortCharacter[]
PlayerEntity := FC.GetEntity[]
then:
# Draw the point on the player
Print("!!! Getting player point")
Sleep(0.0)
PlayerPoint := PlayerEntity.GetGlobalTransform().Translation
Print("!!! About to draw")
Sleep(0.0)
DebugDraw.DrawSphere(PlayerPoint, ?Radius := 50.0, ?Color := NamedColors.Yellow, ?Duration := Inf)
Print("!!! Finished drawing")
Sleep(0.0)
PlayerEntity.AddEntities(array{ GB.Entity })
GB.Entity.SetLocalTransform(BrainrotHoldOffset())
if (set HeldBrainrotByPlayer[Player] = GB) {}
# Block re-interaction while carried, and free a grid spot to respawn.
GB.Disable()
set LiveBrainrotCount -= 1