Windfield physics not working properly?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
jinxy2004
Prole
Posts: 2
Joined: Sat Sep 03, 2022 5:52 am

Windfield physics not working properly?

Post 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.
Andlac028
Party member
Posts: 174
Joined: Fri Dec 14, 2018 2:27 pm
Location: Slovakia

Re: Windfield physics not working properly?

Post by Andlac028 »

Did you defined collision class with world:addCollisionClass("name")? See https://github.com/a327ex/windfield#cre ... on-classes
jinxy2004
Prole
Posts: 2
Joined: Sat Sep 03, 2022 5:52 am

Re: Windfield physics not working properly?

Post 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'}})
Post Reply

Who is online

Users browsing this forum: TurboYeti and 2 guests