Hit Box
Greenkirby21
Member Posts: 32
When I made my image in photoshop, it was 50x50 pixels(the canvas). However, the actual space I used for my actor was about 3/5 of that, around 30x30. So, when my actor collides, it doesn't actually look like it collides because it is hitting the "clear" pixels from the canvas. No matter what I try however, the 50x50 space still exists in my actor. Does this have to do with the actor bug? I resized the image by cropping the canvas to 30x30, and so the image is now flush with the clear canvas background. However, the actor still shows it has a 50x50 canvas even if I remove/add the new image, change the size under actor attributes, everything.
Is there a quicker way, I really don't want to spend forever remaking the actor >_>. The game is almost done and I would need to do it for all my levels!
I read about making a colliding box in my actor, would that work? How exactly do I do that xD!
thanks : )
Is there a quicker way, I really don't want to spend forever remaking the actor >_>. The game is almost done and I would need to do it for all my levels!
I read about making a colliding box in my actor, would that work? How exactly do I do that xD!
thanks : )
Comments
PlayerPositionX
PlayerPositionY
On your main actor, constrain PlayerPositionX to self.positionX and PlayerPositionY to self.positionY
Then make a smaller actor called 'Hit Box'.
In that, Constrain its self.positionX to Player PositionX and its self.positionY to PlayerPositionY
This way, your hit box will follow your main actor.
If you make your hitbox smaller than your actor (and make its colour opacity 0) you'll have a smaller hit area that isn't visible but will follow your actor around.
Hope that helps!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
made the new image, image1.png
deleted old image1.png from images section
hit plus button added new image1.png
dragged new image1.png on top of the actor from the actor pane.
the image changed, but if you click on the actor and look at size, it still says 50x50, insteawd of 30x30 and the image is stretched