When I started using wick editor for the first time, there’s a problem I faced when I was making my first game. I was trying to make a platformer until I made the drawing a clip to use as the ground. Then the blue box appeared. I noticed when my player landed on the ground, it landed on the blue hitbox area. @Luxapodular, maybe in the future you can add an editable hitboxes feature. That would be really helpful!
Well don’t worry, I got some code. (this is @Colonial_Korn’s code, credit to him)
if (this.y > project.height-(this.height/2)) {
this.y = project.height-this.height/2;
}
if (this.y < (this.height/2)) {
this.y = (this.height/2);
}
if (this.x < (this.height/2)) {
this.x = (this.height/2);
}
if (this.x > project.width-(this.height/2)) {
this.x = project.width-(this.height/2);
}
You can change the hitbox through code in version 1.19+ by using a new hitTest function wick added
The latest Wick version (1.19) can always be tested here
My knowledge of how the new hitTest works is pretty low, so here’s what might help:
since i have no clue how the new hittest thing works, the closest answer you’re gonna get from me is this:
to make a hitbox smaller than the animation/sprite you want to use, make a clip specifically for the hitbox and make a clip specifically for the animations. the animation clip needs to be coded to constantly move to the hitbox’s x and y coordinates. the hitbox does the collision, but the player can be bigger (or smaller if you want that) than the hitbox. however, with this solution, the hitbox can only be a rectangle. if that’s okay, then you’re set.
it can also be a circle by using more animations and rotating them in a different way.
You also can create even a cross arrow using 2 rectangle.