Forum

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
http://www.os3.it
14 July 2016 16:24
Hi Roman,

now it works perfectly. Thank you very much for your support and fast reply :-)
http://www.os3.it
14 July 2016 09:48
Hi Roman,

thank you for your help. I have attached my basic project to this message.

I am pretty sure it is something very simple, but I am missing it

Ciao
Fabio
http://www.os3.it
13 July 2016 18:18
Hi Roman,

thank you very much.
I've already looked the article you say and had a look to all the SDK examples.
I think my objects / material are ok in Blender.
I spent all the afternoon searching for my mistake, with no hope .. :-(

Ciao
Fabio
http://www.os3.it
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:

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