playMaker

Author Topic: NavMeshAgent knockback action  (Read 9054 times)

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
NavMeshAgent knockback action
« on: July 16, 2016, 12:47:44 PM »
Feed this action the game object that has hit your agent and it will knock the agent back according to the hit object-



On Snipt and ecosystem
https://snipt.net/raw/c20faa081bfa909176e4389d6ddf9063/?nice
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

fletcherkildren

  • Playmaker Newbie
  • *
  • Posts: 27
Re: NavMeshAgent knockback action
« Reply #1 on: March 08, 2017, 09:18:15 AM »
is this still available? I can't find it on Ecosystem! never mind- just saw you uploaded your actions to github!
« Last Edit: March 08, 2017, 09:33:58 AM by fletcherkildren »

SPACE GAMER

  • Playmaker Newbie
  • *
  • Posts: 35
    • Portfolio
Re: NavMeshAgent knockback action
« Reply #2 on: April 28, 2017, 12:52:07 AM »
NICE!

christougher

  • Playmaker Newbie
  • *
  • Posts: 36
Re: NavMeshAgent knockback action
« Reply #3 on: September 16, 2017, 12:27:21 AM »
Hi, I can't seem to find this specific action on your GitHub. I found one similar at
https://github.com/mdotstrange/MdotsCustomPlaymakerActions/blob/master/KnockbackAction.cs

however this action lacks the smoothing.  Any chance I could peek at the code?  Thx!
Chris

Microfox

  • Playmaker Newbie
  • *
  • Posts: 3
Re: NavMeshAgent knockback action
« Reply #4 on: October 24, 2017, 08:13:18 AM »
Any chance this action is still around somewhere? I can't seem to find it on the GitHub.

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: NavMeshAgent knockback action
« Reply #5 on: October 29, 2017, 08:35:33 PM »
Are you using a Navmesh agent?

I found the proper way to do it with a NavMesh agent is to also use a rigidbody- this is the way I do it now-

So when the agent is hit you switch off the NavmeshAgent- then enable the rigidbody + add a physics force and let that play out for a bit- this way agents can fall from heights etc-

I'll make a new version of this that incorporates that and post it here soon-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

christougher

  • Playmaker Newbie
  • *
  • Posts: 36
Re: NavMeshAgent knockback action
« Reply #6 on: November 05, 2017, 01:36:36 AM »
Looking forward to it!  yes, I'm using a navmesh agent and have a rigidbody as well.  I've tried setting the navmesh agent's updateposition to false and applying force and seem to get inconsistent results...  sometimes it works perfect, sometimes it doesn't seem to click... so, looking forward to seeing it.

christougher

  • Playmaker Newbie
  • *
  • Posts: 36
Re: NavMeshAgent knockback action
« Reply #7 on: November 21, 2017, 03:38:46 PM »
Ever get around to making this?  :D

Nateprinceaudio

  • Playmaker Newbie
  • *
  • Posts: 3
Re: NavMeshAgent knockback action
« Reply #8 on: February 12, 2022, 10:18:59 AM »
Hear is a simple Knock Back Action for navmesh agents i made hope it helps.
it uses the navmeshagent.move so offsets the current path of the agent
you just plug in the players Game object and it works out the knockback via the players position to the enemy.