Basically I want to sense a humanoid in a specific range of a block ( and I already achieved that by calculating the distance between the humanoid and the block, if it is lower than a value then it will start attacking the humanoid ).
The problem is, how do I detect when the humanoid leaves that specific range? ( It is like when in a tower defense game, the tower attacks enemies inside a specific range and when the enemy leaves the range, it stops attacking ). I have searched online and people keep saying to use ray but I don’t really get it. Can somebody explain it to me? Thanks