1 person found this helpful
I'm not really sure whatever that Crysis menu does but if you're just trying to get the object to "look" toward the mouse cursor, slightly modding your code (paste into a new AS3 document), here's a full code example (I'm creating "pnt" in code as well, comment it out to use your object):
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
// only listen to the mouse moving on the stage
// save centered projection
var pp:PerspectiveProjection = this.transform.perspectiveProjection;
// generate pnt center registration
var pnt:Sprite = new Sprite();
// center pnt
pnt.rotationY = ((stage.stageWidth / 2) - mouseX)/5;
pnt.rotationX = (mouseY - (stage.stageHeight / 2))/5;
pnt.x = (stage.stageWidth) / 2;
pnt.y = (stage.stageHeight) / 2;
pp.projectionCenter = new Point(pnt.x, pnt.y);
Maybe that can get you started.
Thank you very much! Works brilliantly both with the script created object and one made seperately (with the name pnt of course )
I will compare both scripts and learn from this. I plan to make it more impressive than squares looking around (perfect way to describe the animation btw) so all of this is really handy.
Thank you again!
If you're all set please mark a correct answer so we can filter out unanswered questions. You're welcome and good luck!