is replacing near with this combo a good idea?

Near 20 player-------and-------Property trigger= true

Replaced with

Always----and-----track to player
Ray 20 player-----and-------property trigger = true

Probably not. The ‘near’ sensor just has to compute the Cartesian distance between the two objects which is pretty simple. Your new setup requires a change-of-basis matrix being applied to ‘track to’ and then a ray cast which requires hit testing.

The only way to know for sure is to make a test scene with a bunch of the ‘near’ sensors then another one with the ‘ray’ system and see how they perform when you add more and more and more of the different types.

I would be very surprised if the ray out performs the near sensor.

The near sensor is pretty heavy. This is because it runs additional to the always computed physics. The processing looks for faces inside the near range, which is much more processing that just looking for a near origin. The advantage is, that you detect even long objects when a side comes near but the origin is still far a way.

You can do checking for origins pretty easy with Python as long as the proposed change to the near sensor is not published.

Your solution with ray will be faster as the ray sensor is not that heavy as a near (but still not light weighted). The problem is that this is a different type of detection. Which means if you compare both options there will be differences. You need to decide if it still fits your needs.

Interesting, I didn’t know that the ‘near’ sensor was doing that much work.