Hello Guest

Author Topic: Whack-a-mole tutorial dust animation position  (Read 5851 times)

ewbutterz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Whack-a-mole tutorial dust animation position
« on: July 24, 2013, 12:56:58 am »
So I have got the whack-a-mole tutorial pretty much finished with one problem.  My dust animation is not appearing directly on top of the mole it is down and to the left. The tutorial said it would be dynamically positioned. What can I do about this? Thanks!

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Whack-a-mole tutorial dust animation position
« Reply #1 on: July 24, 2013, 09:21:09 am »
Hi,

It sounds like the anchor on the dust sprites is in the incorrect position.  In the Project window, select the Dust Sprite Collection then click on the Open Editor button in the Inspector window.  When the sprite collection window opens, select one of the sprites - the Anchor should be set to 'Middle Center' so if it isn't change it to that.  You can multi select all of the sprites and change the anchor on all of them at once.  Remember to commit your changes!

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Whack-a-mole tutorial dust animation position
« Reply #2 on: July 24, 2013, 12:43:23 pm »
Re-reading your post... when you say the animation is down and to the left, do you mean it is 'down and to the left' of the mole that you hit, or it is in the bottom left of the game screen all of the time?  If it's the former, also check the anchor position on the Mole sprites as well, which I've used middle-center for mine.  If the animation is the bottom left of the screen all of the time, have you added the MainGame script to the scene?

ewbutterz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Whack-a-mole tutorial dust animation position
« Reply #3 on: July 24, 2013, 03:52:33 pm »
It is down and to the left of the mole. The dust sprites are anchored to middle center and same goes for the moles. For a quick fix I just added this:
Code: [Select]
new Vector3(mole.transform.position.x + 520, mole.transform.position.y + 200 Its a little hacky but it worked for now. I'd like to get to the bottom of it though! Thanks for the help.
« Last Edit: July 24, 2013, 04:07:11 pm by ewbutterz »

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Whack-a-mole tutorial dust animation position
« Reply #4 on: July 25, 2013, 08:47:59 am »
We have added a link on the tutorial where you can download our package for the tutorial and compare yours against it to see if you can spot the difference.  You can get it from here: http://www.2dtoolkit.com/docs_extras/wam_tutorial21/RestOfGame_Complete.unitypackage .  Or feel free to create an export package of your project and send it to our support email and I'll have a look at it for you.

Thanks.

ewbutterz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Whack-a-mole tutorial dust animation position
« Reply #5 on: July 25, 2013, 10:48:00 pm »
Sweet thanks a lot!