Bookshelf icon indicating copy to clipboard operation
Bookshelf copied to clipboard

Add a way to define custom hitboxes

Open aksiome opened this issue 10 months ago • 0 comments

Feature Name

move:apply_*, raycast:run

Target Module

move, raycast

Feature Description

This could be done by having an optional parameter with coordinates mapped to a voxel shape

EDIT:

These custom hitboxes will be defined using entities, through three new hitbox functions:

  • bs.hitbox:set_entity { with: { width: <float>, height: <float>, depth: <float>, centered: <bool> } }

    • depth controls the Z-axis. If not specified, it defaults to the same value as width.
    • centered determines whether the hitbox is centered on the Y-axis (useful for entities like paintings or item frames).
  • bs.hitbox:reset_entity

    • Resets any custom hitbox data. The entity’s default hitbox remains accessible.
  • bs.hitbox:bake_entity

    • Sets the current hitbox as the entity’s custom hitbox and freezes it.
    • Future scale changes or entity growth (e.g., a baby maturing) will not affect the hitbox.
    • The function also computes a hitbox that encompasses the entire entity stack, including any passengers.

Additional Context

No response

aksiome avatar Feb 25 '25 20:02 aksiome