Page 1 of 1

Can player reach entity?

Posted: Wed Dec 20, 2017 11:47 am
by Mango
I can't find any function that would tell me if player can reach the entity he is pointing at.
Currently im using this:

Code: Select all

if player.reach_distance >= math.abs(entity.position.x - player.position.x) and
player.reach_distance >= math.abs(entity.position.y - player.position.y) then
is there any function doing this?

Re: Can player reach entity?

Posted: Wed Dec 20, 2017 1:00 pm
by Bilka