Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: zendrael on March 26, 2020, 08:27:41 AM

Title: Help on bullet direction
Post by: zendrael on March 26, 2020, 08:27:41 AM
Hello all!
Newbie on Playmaker here!

Searched on the foruns but didn't found what I'm trying to accomplish.

I have an object that rotates on the screen. I'm only working with 2D. I need to shoot a bullet in the direction that this object is rotated. Like a turret (sort of).

Any ideas that could be helpful?

Thanks!
Title: Re: Help on bullet direction
Post by: rechronicle on March 26, 2020, 08:38:32 AM
You can shoot the bullet at the X or Y of your 2D object. Maybe start by learning about how Unity handles the rotation will help you later on.

After that, try looking at 'Look At 2d' and 'Look At 2d Game Object' action.
Title: Re: Help on bullet direction
Post by: zendrael on March 26, 2020, 08:43:54 AM
Hi!

At the moment the bullet just go up the screen, from the point that I put it. Positioning the bullet and creatig another ones is ok, the problem is that it is not going on the direction that the turret is rotated.

Do you mean making the bullet look at the turret?

Thanks
Title: Re: Help on bullet direction
Post by: zendrael on March 26, 2020, 03:08:29 PM
@rechronicle

I think that wahat I'm trying to do is best described as a Tank on a top/down 2D scene. I have the top part of the tank moving (rotating) and want the bullets to shoot in the direction it is rotated.

Please any help would be great!
Title: Re: Help on bullet direction
Post by: rechronicle on March 27, 2020, 10:33:04 AM
Check this out. It should answer your question on how to do it. Not really good at explaining it in words, so I drew a picture of it.