HardonCollider: attempt to call method 'bbox'

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
User avatar
Kibita
Prole
Posts: 31
Joined: Tue Dec 29, 2015 7:46 pm

HardonCollider: attempt to call method 'bbox'

Post by Kibita »

Hello!
This is my first time I am using this library for check collisions between the player and obstacles. I followed what the documentation says to do to check collisions but it show this error message: HC/init.lua:105: attempt to call method 'bbox' (a nil value). I tried to find what caused the error, but I got no idea.

Code: Select all

for shape, delta in pairs(HC.collisions(player)) do
	player:die()
end
All entities (player and obstacles) are created using HC.rectangle().

Thanks for helping.
User avatar
Kibita
Prole
Posts: 31
Joined: Tue Dec 29, 2015 7:46 pm

Re: HardonCollider: attempt to call method 'bbox'

Post by Kibita »

I discovered the problem: I used HC.collisions(player) with playeras a table instead using the shape created from HC.rectangle(). So the code must be like this:

Code: Select all

for shape, delta in pairs(HC.collisions(player.body)) do
   player:die()
end
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests