Adding Hitboxes

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
N3RDY
Prole
Posts: 4
Joined: Sat May 14, 2022 8:33 pm

Adding Hitboxes

Post by N3RDY »

I've been following Challacades' Tutorial:https://www.youtube.com/watch?v=dZzAxYrUMRg for my platformer. When I run the game it shows an error message:

Error

main.lua:30: attempt to index field 'Walls' (a nil value)


Traceback

main.lua:30: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

How do I fix this?
Attachments
main.lua
(2.44 KiB) Downloaded 51 times
User avatar
marclurr
Party member
Posts: 101
Joined: Fri Apr 22, 2022 9:25 am

Re: Adding Hitboxes

Post by marclurr »

Without being able to see "Map1.lua", I suspect you just have to change

Code: Select all

gameMap["Walls"]
on line 30 to

Code: Select all

gameMap.layers["Walls"]
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Adding Hitboxes

Post by ReFreezed »

gameMap should probably be gameMap.layers on that line.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 46 guests