Hey all! I’m new on this forum, and haven’t been coding lua for more then a week. Up till now i haven’t hit any major problems, but i’m at a loss on this one:
I currently have this code to add a previously defined player object to the physics engine:
local playerCollisionFilter = { categoryBits = 1, maskBits = 6 }
local playerBodyElement = { filter=playerCollisionFilter}
physics.addBody ( player, "dynamic", playerBodyElement )
When the player is touching the device, every frame this function is applied to the player:
player:applyForce( boostx, boosty, player.x, player.y )[/code]So far it works fine. The problem arises when i want some better collisions then using a rectangle surrounding my player sprite. I change the first part of the code above to this:[code]local playerCollisionFilter = { categoryBits = 1, maskBits = 6 }local playerShape = {0,-30,-30,15,30,15}local playerBodyElement = { filter=playerCollisionFilter, shape = playerShape} physics.addBody ( p, "dynamic", playerBodyElement )[/code]And suddenly the player just drops down. applyForce seems to have zero effect now. I can't for the life of me figure out why it stopped working. Any ideas would be greatly appreciated. [import]uid: 215620 topic_id: 35547 reply_id: 335547[/import]
