Typically: "How do I... ", "How can I... " questions
-
jianye
- Posts: 46
- Joined: 16 Oct 2019, 13:58
Post
by jianye »
hello,
i implement the following code:
Code: Select all
time_1 = sim.getSimulationTime()
step_time = sim.getSimulationTimeStep()
jp=time_1/step_time
and i get the problem: attempt to perform arithmetic on global 'time_1' (a nil value)
i want to know what is the problem`?
Thank you !
Jian
-
coppelia
- Site Admin
- Posts: 10364
- Joined: 14 Dec 2012, 00:25
Post
by coppelia »
Hello Jian,
this code works fine here... just after calling sim.getSimulationTime(), print the time_1 variable to see what it contains.
Cheers