Page 1 of 1

Windfield physics not working properly?

Posted: Sat Sep 03, 2022 9:59 pm
by jinxy2004
Is anyone else having issues with the windfield physics library not working? For example, my character can go through walls, which are static and a collision class.

Code: Select all

function spawnWalls(x, y, width, height)
    if width > 0 and height > 0 then
        local wall = world:newRectangleCollider(x, y, width, height)
        wall:setCollisionClass('Wall')
        wall:setType('static')
        table.insert(walls, wall)
    end
end

Some collision classes also just don't work, for example I have an enemy class that should ignore the payer class, yet it doesn't the player can push it around.

Re: Windfield physics not working properly?

Posted: Sun Sep 04, 2022 7:12 am
by Andlac028
Did you defined collision class with world:addCollisionClass("name")? See https://github.com/a327ex/windfield#cre ... on-classes

Re: Windfield physics not working properly?

Posted: Tue Sep 06, 2022 1:51 am
by jinxy2004
Yeah,I defined them all after I created my physics world like this. They do work sometimes but not all of the time.
world:addCollisionClass('Player')
world:addCollisionClass('Wall')
world:addCollisionClass('Enemy', {ignores = {'Player'}})
world:addCollisionClass('Weapon', {ignores = {'Player'}})
world:addCollisionClass('Bullet',{ignores = {'Player','Enemy'}})