User posts Fabio
01 August 2016 13:22
Hello everybody,
I don't know how to read global variables from JavaScript.
I have created a node in logic editor (see attached image) with a global variable name called "pizza" and "margherita" as string value.
Is there any API to access global variables (for both reading and writing)?
Thanks,
Fabio
I don't know how to read global variables from JavaScript.
I have created a node in logic editor (see attached image) with a global variable name called "pizza" and "margherita" as string value.
Is there any API to access global variables (for both reading and writing)?
Thanks,
Fabio
http://www.os3.it
14 July 2016 16:24
14 July 2016 09:48
13 July 2016 18:18
13 July 2016 17:31
Hello,
my name is Fabio and I am really new here :-)
In a test project I am writing, I am trying to detect cubes collisions but there must be something that escapes me because the events are not fired.
My code is quite simple: for each cube in my scene, I do the following:
but even if the objects actually collide in the scene, the "HIT!" message never appears on my debug console.
What should I check?
Thank you for the support.
Ciao
Fabio
my name is Fabio and I am really new here :-)
In a test project I am writing, I am trying to detect cubes collisions but there must be something that escapes me because the events are not fired.
My code is quite simple: for each cube in my scene, I do the following:
var obj = objs[i];
if ( m_phy.has_physics(obj) )
{
m_phy.enable_simulation ( obj );
// create sensors to detect collisions
var sensor_col = m_ctl.create_collision_sensor ( obj, "ANY" );
m_ctl.create_sensor_manifold (
obj, "COLLISION", m_ctl.CT_CONTINUOUS, [ sensor_col ],
function ( o ) { return o [ 0 ]; }, function () { console.debug ( "HIT!"); }
);
}
but even if the objects actually collide in the scene, the "HIT!" message never appears on my debug console.
What should I check?
Thank you for the support.
Ciao
Fabio
http://www.os3.it