[SOLVED] Can't properly set hitbox


(Vampir) #1

Hello. I have an image with width=45 and height=20, I need to use it for for platform-objects in my game. This code is ok to use whole image as hitbox:

setHitbox(45, 20);

But actually this picture is isometric so I need hitbox with size = (40,20) and x-offset = 5 (I want player to be able to go through leftmost 5x20 area of platform). So I tried this

setHitbox(40, 20, 5);

and this

setHitbox(40, 20, 25);

and so on. Results are always wierd, collision system goes completely crazy. Please help me to properly set hitbox.

P.S. sorry for my english.


(Jacob Albano) #2

If you enable the developer console, you can see exactly where your hitboxes are by toggling it with the tilde key ~.

FP.console.enable();

(Vampir) #3

Great! This

setHitbox(40, 20, -5);

works fine. Thank you :smile: