Hi, I am trying to disable the movement of an object on x-axis. I try
I need that the obj interact only on y-axis.
The problem is when I drag on the x-axis or try to rotate pressing a key, the object don't stay in x = 0.
When I release the obj, it returns to x = 0. How can I avoid this behavior?
Thanks.
Code: Select all
world.addEventListener(Event.ENTER_FRAME, loop);
function loop(evt:Event):void
{
obj.x = 0;
obj.syncTransform();
}I need that the obj interact only on y-axis.
The problem is when I drag on the x-axis or try to rotate pressing a key, the object don't stay in x = 0.
When I release the obj, it returns to x = 0. How can I avoid this behavior?
Thanks.