edit dynamical object material via LUA script
Posted: 03 Apr 2020, 21:35
is it possible to edit the dynamical object material via script, without remote api?
my idea is to create an interface with 4 buttons, each button will set a friction coefficient of the object
i use example : simple Ackermann
Lua runtime error : attempt to call field 'bullet_body_friction' (a number value)
Gustavo Duarte, Brazil.
my idea is to create an interface with 4 buttons, each button will set a friction coefficient of the object
i use example : simple Ackermann
Code: Select all
function sysCall_threadmain()
-- Put some initialization code here:
-- Retrieving of some handles and setting of some initial values:
steeringLeft=sim.getObjectHandle('nakedCar_steeringLeft')
steeringRight=sim.getObjectHandle('nakedCar_steeringRight')
motorLeft=sim.getObjectHandle('nakedCar_motorLeft')
motorRight=sim.getObjectHandle('nakedCar_motorRight')
d_right=sim.getObjectHandle('nakedCar_frontRightWheel_respondable')
d_left=sim.getObjectHandle('nakedCar_frontLeftWheel_respondable')
r_left=sim.getObjectHandle('nakedCar_rearLeftWheel_respondable')
r_right=sim.getObjectHandle('nakedCar_rearRightWheel_respondable')
r1= sim.setShapeMaterial(d_right, sim.bullet_body_friction (0.3))
r2= sim.setShapeMaterial(d_left, sim.bullet_body_friction (0.3))
r3= sim.setShapeMaterial(r_right, sim.bullet_body_friction (0.3))
r4= sim.setShapeMaterial (r_left, sim.bullet_body_friction (0.3))
Gustavo Duarte, Brazil.