Hi, i have some 3d objects on my screen which should react when the mousepointer touches them. It works fine with all entities in the level, but i have problems with those which are only on screen.
like this one, I have defined the entity:
Code:
entity INV_kaffeebecher
{
type="kaffeebecher.mdl";
view=top_view;
layer=2;
x=20;
y=9.74;
z=-7.4;
roll=2;
tilt=12;
scale_x=0.05;
scale_y=0.05;
scale_z=0.05;
flags= visible;
}
The following function is called in the mainfunction.
Code:
function item_kaffee()
{
INV_kaffeebecher.enable_touch=on;
INV_kaffeebecher.enable_release=on;
INV_kaffeebecher.enable_click=on;
INV_kaffeebecher.event=reaktion_kaffeebecher;
while(1)
{
INV_kaffeebecher.pan += 5*time;
INV_kaffeebecher.pan %= 360;
wait(1);
}
}
I have no errors, and the entity is rotating. So the function works, but it doesn't react to touch, release and click. Of course I have a function to tell the engine what should happen like this way.
Code:
function reaktion_kaffeebecher()
{
if(event_type == event_touch)
{ INV_kaffeebecher.visible = off;
}
if....
...}
but nothing happens. Do you have an idea?