Can someone help me with this error
Posted: Wed Dec 28, 2022 6:03 am
I am using the love physics and I am getting this error
Error
main.lua:7: bad argument #2 to 'newFixture' (Shape expected, got nil)
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'newFixture'
main.lua:7: in function 'load'
[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
[C]: in function 'xpcall'
[C]: in function 'xpcall'
although i am not sure what is wrong. My code looks like this
function love.load()
game = love.physics.newWorld(0, 0, true)
playerimage = love.graphics.newImage('assets/PLAYER.png')
player = love.physics.newBody(game, 500, 500, "dynamic")
player:setFixedRotation(true)
playerhitbox = love.physics.newCircleShape(95)
PlayerFixture = love.physics.newFixture(player, circle, 1)
end
if someone is able to help me, then please tell me what is wrong
Error
main.lua:7: bad argument #2 to 'newFixture' (Shape expected, got nil)
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'newFixture'
main.lua:7: in function 'load'
[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
[C]: in function 'xpcall'
[C]: in function 'xpcall'
although i am not sure what is wrong. My code looks like this
function love.load()
game = love.physics.newWorld(0, 0, true)
playerimage = love.graphics.newImage('assets/PLAYER.png')
player = love.physics.newBody(game, 500, 500, "dynamic")
player:setFixedRotation(true)
playerhitbox = love.physics.newCircleShape(95)
PlayerFixture = love.physics.newFixture(player, circle, 1)
end
if someone is able to help me, then please tell me what is wrong