Change the sensor frequency in game?

Hi!, is there a way to change the frequency of an sensor while the game engine is still running?

I believe you can modify the frequency by accessing the sensor, and setting “sensor.frequency = n” which would update the sensor next frame.

hmm good to know! thx for the help, I will try it!

It did work, here is an example code:

import bge
cont = bge.logic.getCurrentController()
sens = cont.sensors["sens"]
sens.frequency = sens.frequency +1

makes the freq skip one more tic every tic :smiley:

tip: use += 1 for easy incrementing

sens.frequency += 1
Good job :slight_smile: