- Home /
Question by
stevenp · Feb 14, 2012 at 10:04 AM ·
javascriptinstantiatetranslate
Instantiate and move a single object on click
Basically, I want the object to appear when the button is pressed and it follows the mouse pointer after I move it within specified distance. Then, I want the object to "disappear" when I release the button.
I know how to instantiate the object but I encountered a problem of removing that instantiated object before. So I tried to manipulate the visibility of the object and I can't be sure if it is a good method. Any tips and advice regarding this is appreciated. The main problem is making the object to follow the mouse position. My game is 2D and I'm using Orthographic projection. Thank you in advance.
Comment