The block's hitbox changes when the block X coordinate changes in lua

Need help with any SMBX game-related issues? Ask your questions here.
AiriableConditions
Shy Guy
Shy Guy
Posts: 6
Joined: Wed Feb 17, 2021 8:11 am
Pronouns: he, him
Contact:

The block's hitbox changes when the block X coordinate changes in lua

Postby AiriableConditions » Sun Nov 26, 2023 1:21 pm

If I set the block's x coordinate to anything that's out of the area of the block by about 2 blocks, the hitbox shrinks. If it goes far enough, the x hitbox is disabled entirely. What's weird is that this seemingly only happens with x block coordinates, and not y coordinates.

Here's an example:
v.x = -199488

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9722
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: The block's hitbox changes when the block X coordinate changes in lua

Postby Emral » Sun Nov 26, 2023 6:14 pm

Block collision is internally sorted by the game to improve collision check performance. If you want to move a block programmatically, use the block:translate(dx, dy) method

-- moves 1 pixel to the right:
v:translate(1, 0)


Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari