Playmaker Forum

PlayMaker News => General Discussion => Topic started by: VictorRayDev on October 23, 2012, 02:02:46 PM

Title: Grenade Throw at player[SOLVED]
Post by: VictorRayDev on October 23, 2012, 02:02:46 PM
Hi, My name is Max I'm new here
I have a "little" question i'm making a 2D game and I need to create an action where my Ai can throw grenade at the player

I need to find a mathematic formula to apply the good force the my grenade so it make a nice arc movement and go in the direction of the player. I'm pretty newb with radian and stuff like that.

Can someone enlighten me?

(sorry for my poor english I'm french canadian)
Title: Re: Grenade Throw at player
Post by: VictorRayDev on October 23, 2012, 03:49:21 PM
ok I just found this custom action by Jean Fabre. http://hutonggames.com/playmakerforum/index.php?topic=2373.0 It does exactly what I wanted to be able to do... Thanks a lot Mr. Fabre!
Title: Re: Grenade Throw at player
Post by: jeanfabre on October 24, 2012, 04:02:04 AM
you are welcome :)
Title: Re: Grenade Throw at player
Post by: VictorRayDev on October 31, 2012, 10:45:22 PM
Hey guys!
Ok my grenade thrower ennemy work perfectly. I send variable from the distance of the foe to of the hero to the range of the "physic shoot" function ennemy and boom!

Now I want to make a rocket launcher. I have a little problem.
I'm feeding the angle of the hero relative to the foe in a variable using the "get angle to target" playmaker function.

The problem I have is that when my hero is touching the ground, the rocket go just a little bit over his head.
It's like the "get angle to target" is not precise enough
Can somebody help me?
thx!

Title: Re: Grenade Throw at player
Post by: VictorRayDev on October 31, 2012, 11:01:24 PM
Ok nevermind   :D
I found that the calculation of the angle is from the center point my calculation was from the middle of the cube... this is why the angle was false it as to start from the ground... So I made my mesh really small near the the ground, now everything work normal...