Page 1 of 1

How to set the simulation time dt through script of client?

Posted: 29 Aug 2025, 07:46
by Hacher
The simulation velocity of dt can be changed in the 'simulation setup' dialog box, it's there any function like 'sim.startsimulation' that allow me to change the simulation velocity through script in the python client

Re: How to set the simulation time dt through script of client?

Posted: 29 Aug 2025, 08:38
by coppelia
Hello,

try with sim.setFloatProperty(sim.handle_scene, "timeStep", 0.01)
Just make sure simulation is not yet running.

Cheers

Re: How to set the simulation time dt through script of client?

Posted: 02 Sep 2025, 15:19
by Hacher
Encounter an error when I try to use

Code: Select all

sim.setFloatProperty(sim.handle_scene, "timeStep", 0.01)
:
Exception: 347: in sim.setFloatProperty: unknown property.

Re: How to set the simulation time dt through script of client?

Posted: 02 Sep 2025, 15:51
by coppelia
What CoppeliaSim version are you running? What does it print when you type:

Code: Select all

sim.getProperties(sim.handle_scene)
Cheers

Re: How to set the simulation time dt through script of client?

Posted: 02 Sep 2025, 16:05
by Hacher
The version I am using is 4.7.0, I encounter error:
AttributeError: type object 'sim' has no attribute 'getProperties'

Re: How to set the simulation time dt through script of client?

Posted: 03 Sep 2025, 12:28
by coppelia
If you want to change the timestep with versions prior to V4.9, use:

Code: Select all

sim.setFloatParam(sim.floatparam_simulation_time_step, 0.01)
Cheers