GameSalad

Can't create a clone actor at mouse then destroy after 1 second

jdrzljdrzl Posts: 6Member

I am trying to create an actor at my mouse coordinates (which works fine), but then destroys after one second (which also works fine). The problem is when you click multiple times between that one second time period because then it will only destroy the first actor and keep the second.

If anyone has a fix for this that would be great!

Thanks

Comments

  • IceboxIcebox Posts: 1,201Member, PRO

    It shouldn't do that

    if mouse button is down
    spawn actor
    x mouse positionx
    y mouse positiony
    relative to scene

    In the actor
    if self.time >1
    destroy

    it should work fine

  • jdrzljdrzl Posts: 6Member

    @Icebox Thank you,
    That was a lot easier than what I had, before I was trying to create a new attribute and have a timer so after 1 second it would destroy. But this worked a lot better, thanks!

Sign In or Register to comment.