Help with shooting mechanic

Hey, I'm so close to getting this to work. Basically I have a sniper target that I can move around on screen and shoot BUT the issue is getting it to not fire at every touch.

So I set up two attributes tap1 and tap2. At first press tap1 is active, if active and press is released, tap2 is active. If tap2 is active a press release will fire. But now I need away to tell tap1 and tap2 to reset to 0 if I press again to move the target elsewhere without it firing again on release.

Ideally I want to be able to move the target, then tap on it to fire, move around, tap to fire all on the same target actor.

Comments

  • TheGabfatherTheGabfather Member Posts: 633
    edited April 2013
    I've never done shooter games before, but I imagine you can have an invisible actor Scope1 (sized considerably) that moves to the location of where you tapped first. At second tap, have a Scope2 actor (a fraction of the size of Scope1) move to the tap's location.

    If Scope2 is not within the boundaries of Scope1 (ie. does not collide) then reset or deactive tap1 and tap2?

    I think that should work :) hopefully.

    Edit: does your Sniper Target follow tap1? Then that can be your equivalent to Scope1

    Edit2: I have a sneaking suspicion your game's controls are different from what I have in mind. If you can elaborate, perhaps I can see if my solution is not applicable to your game, so I can correct it :)
  • LiquidGameworksLiquidGameworks Anchorage, AKMember, Sous Chef Posts: 956
    Maybe you can have something that detects the drag... Like, if mouse button is down, after 1 seconds change Tap to 0.
  • SingleSparqSingleSparq Member Posts: 1,339
    Yes the scope is constrained to the finger position, so tap then move around to your target, lift then tape to fire, tap again if you wish to fire again, or tap and drag and to a new target position on screen. I am thinking in line of a timer.
Sign In or Register to comment.