Playmaker Forum

Playmaker Help & Tips => Playmaker Help => Topic started by: OddButAwesome on September 30, 2015, 11:06:55 AM

Title: Jet flames based on movement/Velocity?
Post by: OddButAwesome on September 30, 2015, 11:06:55 AM
Hi all,

Having a bit of a challenge getting jet flames (mesh plane object) to scale into view when the player moves. Currently using a prefab 'MobileSingleStickControl' which works well enough. So flames can't appear based on keystrokes but I guess should appear based on ship movement or joystick direction.

Game is a 2D shooter type. Player is a ship with guns facing right. I would like the jet flames to appear on the top, rear and bottom when the player moves down, right and up respectively. i.e. player moves down flames appear on the top.

I was originally hoping to read the direction of the ship and have the flames scale as per the paragraph above. Each flame objects has its own (empty) parent which is centered on the player object so by scaling the parent the flame should appear to the person playing to shoot in and out.

Am I going about this totally wrong? What is a better way?

The pics below - the FSM is attached to the player.

Still new at this. Any help would be most appreciated.

Thanks.

Title: Re: Jet flames based on movement/Velocity?
Post by: djaydino on September 30, 2015, 12:37:01 PM
Hi,
I think i would use the animator for this and use 2x get axis, 1 for horizontal and 1 for vertical and use set animator float
this way you can make some nice animated sprites

Here (http://hutonggames.com/playmakerforum/index.php?topic=5671.0) you can find a tutorial for 2d and animation,
look for 2D Sprite Based Platformer part 1 and 2