Overlaps or collides with multiple actors only seems to be working when drawing a line very quickly?

Hey Guys. I'm trying to spawn a third actor if a line I draw touches two other actors at the same time, by drawing one line through both of them, actor 1 and actor 2. The 3rd actor doesn't want to spawn if I take a few seconds to go from actor 1 to actor 2, however after troubleshooting I realised I can make the 3rd actor spawn if I draw the line very quickly between actor 1 and actor 2. Any ideas as to why it's not working when I draw very slow? I've used Orbzample's drawer demo for the drawing part. Mockup attached. Thanks

Comments

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited August 2014

    @revoltandreverb‌, have a look at your last rule in the "Segment", you are testing for overlap of both Actor1 and 2. Should the 3rd actor only spawn when actor 2 is reached or either 1 or 2?

    If you are trying to see if both actors where touched, the set game level attributes as each actor is touched

    Rule: if overlaps with Actor1 then change attribute game.Actor1 = 1

    Rule: if overlaps with Actor2 then change attribute game.Actor2 = 1

    then have a third rule

    Rule: if game.Actor1=1 and game.Actor2=1 then spawn Actor3

  • revoltandreverbrevoltandreverb Member Posts: 159

    Thanks, that worked a charm. I would still like to know why it worked when I drew quickly but not when I drew slowly?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Well you had both overlap checks in one rule, and both had to be true. This only occurs when you draw a line between the two targets so fast that the first condition is still true when the second overlaps happens.

  • revoltandreverbrevoltandreverb Member Posts: 159

    mmm wouldn't both be true the
    moment the line reaches the second actor, even if I draw slowly?

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited August 2014

    No, the "overlaps or collides" event is only true at the time the actor actually overlaps with the target actor. As more "Segment" actors get spawned over time, each does its own testing, not remembering that the first instance is still overlapping with the start actor. This only happens when you draw so fast that only a single "Segment" gets spawned between the start and end actor.

  • revoltandreverbrevoltandreverb Member Posts: 159
    edited August 2014

    aha! Thanks! My problem was thinking the line was one big actor instead of tiny bits that were spawned a lot of times to look like a line.

Sign In or Register to comment.