**UPDATE: So to do this:
- You have to pre-declare your object,
- Build your object,
- Use the object:removeSelf() when you want to change the hitbox and immediately re-build the object again with a changed hitbox.
(See post #2)**
Hi there,
I have an object and i want to alter it’s Hit box.
Think of it as: a man with full body hitbox, then he crouches, i only want half of the full body hitbox.
local playerbody = display.newImage("Images/Robot.png", \_W, \_H);
playerbody:setReferencePoint(display.CenterReferencePoint);
playerbody.x = \_W/2-50; playerbody.y = \_H/2;
physics.addBody(playerbody, {density = 1.5, friction=1.0, shape={-19, 64, -19, 0, 19, 0, 19, 64 }});
I can’t seem to change the ‘shape={}’ i’ve attempted variables, but i dont know how to update the object.
I can’t use physics.removeBody() because i’m only a trial user.
I have tried using removeSelf and recreating the image with a smaller bounding box and it works but also crashes the system because playerbody.x & .y are not longer affliated with it and are still being continuosly checked.
Has anyone got a work around for this?
How to update it or change it?
Thanks in advance.
Matt [import]uid: 91798 topic_id: 15664 reply_id: 315664[/import]

