HitBox doesnt seem to update after setSize() #2605
Replies: 3 comments 7 replies
-
can you be specific about what is happening vs what you're expecting to happen? setSize sets width and height, which affects the hitbox but doesn't change the graphic, offset moves the graphic in relation to the hitbox |
Beta Was this translation helpful? Give feedback.
-
you also need to do |
Beta Was this translation helpful? Give feedback.
-
So from what I have investigated, somehow it does not work in I moved class PlayState extends FlxState
{
var player:Player;
var map:FlxOgmo3Loader;
var walls:FlxTilemap;
function placeEntities(entity:EntityData)
{
if (entity.name == "player")
{
player.setPosition(entity.x, entity.y);
player.setSize(8, 8);
player.offset.set(4, 4);
}
}
... And suddenly it works. It has to have something to do with how |
Beta Was this translation helpful? Give feedback.
-
(ik that offset is wrong)
the player (this gets called in player script) is 32x32 but does not actually take that whole space, so it would be reasonable to change the hitbox, but it doesnt seem to work
Beta Was this translation helpful? Give feedback.
All reactions