Not Spawning Actor on First Click

robert.mccarthyrobert.mccarthy Member Posts: 165
edited February 2012 in Working with GS (Mac)
Hi All,

Currently, when I click an actor I want it to spawn another actor in the same place...my current implementation is:

ON THE ACTOR I AM CLICKING:
When 'mouse button is down' & 'mouse position is inside' then 'Spawn Actor'

Now I know that this should not be a problem, I have been working with GS for a while now. However, I have found that the first click I perform on the actor doesn't spawn the actor I want.

I have to click it again to get it to spawn.

After the first click (which spawns nothing), it then works ok for all subsequent clicks.

Has anyone seen this before, and does anyone know why this is occurring?

Many thanks

Comments

  • CloudsClouds Member Posts: 1,599
    Has anyone seen this before, and does anyone know why this is occurring?

    Yes & no.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    why not just do when touch is pressed?
  • robert.mccarthyrobert.mccarthy Member Posts: 165
    I have worked this out:

    First of all, the click actor (Jim) and spawn actor (Fred) were the same image/size etc. (I call the actors names to help with the explanation :) )

    When clicking on the actor (Jim) to spawn the new actor (Fred) directly on top, I was then constraining actor (Fred) to my mouse position while my mouse was still down.

    The problem was that the constrain I did was occurring when 'Touch: is Pressed' and it should have been when 'Mouse Button: is down & Mouse Position: is inside'

    I hope that helps explain what I did, and maybe helps others in the future...i.e. if your clicking to spawn and then the spawn constrains to mouse upon spawn, use 'Mouse Button: is down & Mouse Position: is inside' rather than 'Touch: is Pressed'.

    Probably a newb error, of which I appologise for wasting peoples time.

    Thanks,
Sign In or Register to comment.