# bge - EditObjectActuator.time changed at will?

with a script, can we change at will the EditObjectActuator.time ? in my case, I want to add time of life to an object, while the game is running with a property or a message from another object ... I 'm a newbie in scripting with Python, I used to code with logic bricks but I do not know how to do ...

JL

I've tried many methods uncessfully. So I simplified the code to show what I want to do. This is the head of the snake

The problem is "How to increase the timelife at will ?"

Yes, not only you can change the actuator.time attribute in realtime, but you can add an object without an actuator.

# Change the time based on a property

import bge

cont = bge.logic.getCurrentController()
own = cont.owner

act.time = own["MyProperty"]
cont.activate(act)


import bge

cont = bge.logic.getCurrentController()
own = cont.owner
scene = own.scene

# Both objects can be from scene.objects instead of names