playMaker

Author Topic: Button to Shoot Cannon  (Read 1860 times)

PlaymakerNovice

  • Playmaker Newbie
  • *
  • Posts: 18
Button to Shoot Cannon
« on: August 31, 2015, 07:50:09 PM »
I'm making a game where when an object touches a button, a ball is shot from a cannon nearby it. (its 2D btw). I created a global event that is sent every time the character is on top of the button (collides). A ball is then created inside of the cannon (under the sprite), and then shot (translated to the right). It works, but only once. Every time the character goes over to button again nothing happens. How can I get this to work?
« Last Edit: August 31, 2015, 07:52:44 PM by PlaymakerNovice »

PlaymakerNovice

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Button to Shoot Cannon
« Reply #1 on: August 31, 2015, 07:51:51 PM »
Also want to add that Gamemanager which is just an empty gameobject is what creates the ball when the button is hit and the global event is sent.. The only state the ball itself does is translate.

Grendal

  • Playmaker Newbie
  • *
  • Posts: 31
Re: Button to Shoot Cannon
« Reply #2 on: August 31, 2015, 10:00:30 PM »
Make a "listener" type state (watch tutorial videos) that waits for the on clicked event then send an FIRE transition to another state that does the actual global event transition call to cannon (we will call it FIRING state).. from this FIRING state use a FINISHED transition to go back to listener state where it waits for another on click event.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Button to Shoot Cannon
« Reply #3 on: September 01, 2015, 12:38:23 PM »
Hi,
Here is PM Youtube Chanel
Here you can find several tutorials to get you started