How to make entity load when player is within a specified distance of it

like level loading. so i want it so that when the player walks toward a different part of the map(seperate from the spawn area), it will load in, but if the player is not near it, it will be disabled
how would i do this?

Hi @quantum!

You can achieve this with using triggers or check the distance from the player to the location point in your map.

Using triggers:

Using distance:

// update function
var player ='EntityNameOfPlayer');
var point ='EntityNameOfLocactionPoint');
var range = 10;

if (player.getPosition().distance(point.getPosition()) < range) {
    // enable
else {
    // disable

thanks i will try it