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

jdrzljdrzl Member Posts: 6

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 Member Posts: 1,485

    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 Member Posts: 6

    @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.