playMaker

Author Topic: Grenade Throw at player[SOLVED]  (Read 4761 times)

VictorRayDev

  • Playmaker Newbie
  • *
  • Posts: 35
Grenade Throw at player[SOLVED]
« 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)
« Last Edit: November 01, 2012, 01:37:34 AM by jeanfabre »

VictorRayDev

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Grenade Throw at player
« Reply #1 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!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Grenade Throw at player
« Reply #2 on: October 24, 2012, 04:02:04 AM »
you are welcome :)

VictorRayDev

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Grenade Throw at player
« Reply #3 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!


VictorRayDev

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Grenade Throw at player
« Reply #4 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...