playMaker

Author Topic: Launch a Grenade, Projectile or Cannon Ball with Path Prediction  (Read 8030 times)

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Tutorial and custom action.

1. Imagine you want to throw your grenade (or missile or whatever) to a specific location, from a specific location. Ie, from your hand to the bad guys face. But how do you know exactly how much force to apply to get that rigidbody grenade to land at the exact spot? Watch the tutorial and download the custom actions from my github account!

It only takes 1 action to calculate and 1 action to launch. Easy.

2. Imagine you want to predict the path of that grenade BEFORE you throw it. And render the line on screen to show your players. That way they can decide if they want to throw it. I have a custom action for that too! (Please note, this second custom action set requires a paid asset called "Trajectory Predictor". https://www.assetstore.unity3d.com/en/#!/content/55752

I wrote a custom playmaker action to predict the path from playmaker (to use with this asset). The action is free, the asset is not.

All of this is covered in my tutorial here on youtube:
This is all rigidbody based (no animations), so that your grenade can hit a wall or bounce off the floor naturally. These calculations work with any height! No need for a flat ground.

Actions can be found here (although I strongly suggest you watch the tutorial first: https://github.com/dumbgamedev/general-playmaker/tree/master/projectiles

If you like these custom actions and tutorials, feel pledge a few $ into my patreon account. https://www.patreon.com/playmaker
« Last Edit: June 18, 2017, 05:22:38 AM by tcmeric »

Pandur

  • Full Member
  • ***
  • Posts: 122
Re: Launch a Grenade, Projectile or Cannon Ball with Path Prediction
« Reply #1 on: July 02, 2017, 01:03:14 AM »
thx for that tutorial,i have looking for a long time for it.

by the way can you make a playmaker action for that damage system of this asset?
https://www.assetstore.unity3d.com/en/#!/content/78899

I have look yesterday how i can use it with set property but the shootingHandler in that asset can not be use with playmaker,but this damage system is very nice and usefull for other npc´s (ragdolls with BodyParts)and works a lot better as the Dismembering Asset (https://www.assetstore.unity3d.com/en/#!/content/90674)

Thx :D

Prestonh

  • Playmaker Newbie
  • *
  • Posts: 44
Re: Launch a Grenade, Projectile or Cannon Ball with Path Prediction
« Reply #2 on: November 07, 2018, 01:34:31 PM »
Anyone anle to update the action?  It just gives me errors.  But its such a beautiful action (that i want)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Launch a Grenade, Projectile or Cannon Ball with Path Prediction
« Reply #3 on: November 07, 2018, 01:44:37 PM »
Hi.
You might want to pm to tcmeric
and when you ask, add the link to this post :)

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Launch a Grenade, Projectile or Cannon Ball with Path Prediction
« Reply #4 on: November 07, 2018, 08:27:50 PM »
What is the error? Do you have Trajectory Predictor Asset in your project?

jermerqua

  • Playmaker Newbie
  • *
  • Posts: 31
Re: Launch a Grenade, Projectile or Cannon Ball with Path Prediction
« Reply #5 on: March 29, 2020, 02:44:14 PM »
I got excited there for a second because I did not have trajectory predictor installed but I did just now go ahead and install it and it's still throwing up a bunch of errors.

I've attached the errors here. Scratching my head when I look at them all :-)


Could it be the version of the Unity file when I star new (.3.7 vs .2.9 vs 1.14)

« Last Edit: March 29, 2020, 02:59:29 PM by jermerqua »

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: Launch a Grenade, Projectile or Cannon Ball with Path Prediction
« Reply #6 on: March 30, 2020, 03:17:24 AM »
Sounds good. I've wondered at times how it would work but never needed to do it. Bookmarked now for future reference. Thanks.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Launch a Grenade, Projectile or Cannon Ball with Path Prediction
« Reply #7 on: March 30, 2020, 06:21:41 AM »
Hi, try deleting any of the actions that are giving you errors. Then see if unity will compile properly. Start from the top of the debug list (red errors) and work your way down.

jermerqua

  • Playmaker Newbie
  • *
  • Posts: 31
Re: Launch a Grenade, Projectile or Cannon Ball with Path Prediction
« Reply #8 on: March 30, 2020, 11:36:08 PM »
Ok, so i think I'm getting somewhere on this. Thanks for support.

So I took your advice and kept deleting the .cs files that were associated with the many errors. I deleted a couple then a couple new ones would appear. I deleted those and now I finally got it down to these few errors which I don't understand. With that said the custom panel in actions is at least now showing up. See screenshot...

UPDATE: I JUST CLOSED UNITY AND REOPENED AND IT SEEMS TO BE WORKING. GOING TO WALK THROUGH TUTORIAL TOMORROW.
« Last Edit: March 30, 2020, 11:45:28 PM by jermerqua »

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Launch a Grenade, Projectile or Cannon Ball with Path Prediction
« Reply #9 on: April 21, 2020, 06:12:02 PM »
For myself and others, are your current actions the 3D versions of basically this? :D
https://hutonggames.com/playmakerforum/index.php?topic=21916.0