playMaker

Author Topic: Projectile moving past target  (Read 2502 times)

Uttpd

  • Junior Playmaker
  • **
  • Posts: 70
Projectile moving past target
« on: August 16, 2012, 09:32:23 AM »
I have my guy shooting arrows to a "target" defined by my right mouse positing while pressed.
Using "Move Towards" action, the arrow moves stopping at the target.. as i told her to do.
but,
I want the arrow to move past the target for a bit more

Need to add some value/ vector3 to my Target to offset some distance in the same direction the arrow was traveling. Or any other way!
Thats where my math skills leave me in the cold any help appreciated.


Setting the finish distance to a negative value does not work. (it results in the object never reaching the "Finish Event" and thus never leaving the state)

PS: Ofcourse all this would be fixed if the Finish Distance accepted negative values.. jean hint jean
PS2: "Get Vector Length" and "Set Hands Position" have the same tooltip and are missing the description on the Action Reference docs.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Projectile moving past target
« Reply #1 on: August 17, 2012, 03:09:12 AM »
Hi,

 from the moveTowards tooltip :

Quote
The Target can be specified as a Game Object or a world Position. If you specify both, then the Position is used as a local offset from the Object's Position.

so in your case, you would need some small rig:

have a "target" dummy gameObject that follows the position of your ennemy you are shooting at, this "target" is looking back at the player firing. the arrow is moving towards the "target" with a local offset position as described in the tooltip.

You can't use the ennemy gameObject for a local offset, because he could be in any orientation, that's why you need to first set up this "target" so that the arrow continues its path in a realistic manner.
 
bye,

 Jean

Uttpd

  • Junior Playmaker
  • **
  • Posts: 70
Re: Projectile moving past target
« Reply #2 on: August 17, 2012, 02:53:08 PM »
Thanks Jean, that sounds dangerous.. :) Will add the dummy trick to my arsenal.

I went with making visible another Arrow down the path, after the first collid or end is move, since is a fast moving object you can not tell the difference.

Now getting the Hit collision to work predictably is another challenge. The arrow only "sticks" on Hit sometimes..

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Projectile moving past target
« Reply #3 on: August 20, 2012, 03:47:09 AM »
Hi,

 you should get the collision info straight after receiving the collision event. is that what you are doing?

bye,

 Jean