Currently, in my game, when the player takes damage from an enemy, they take damage for every frame they’re in contact with the enemy and die instantly.
I tried disabling the collision box when they collide (planning to re-enable it after a few seconds of invulnerability) but that leads to the player being able to walk through walls.
Is there a way to make the player collision group ignore the enemy collision group temporarily?
Why don’t you create a variable to track invulnerability?
Just a very simple concept:
if not self.invulnerable then
--take damage here
--set invulnerability
self.invulnerable = true
timer.delay(3, false, function()
--reset invulnerability
self.invulnerable = false
end)
end
2 Likes
oh yeah that’s a lot easier, thanks for the help again lol