edited March 2014 in ORK Support
Hey GiL, I saw you post in the Unity Forum that you can use the Explosion Rigidbodies for knockback effect. I was curious, so I tried it, with no luck.
In my attack event, I do it in the following order:
Event Setting --- Spawn Sparks ---- Destroy Sparks --- Spawn Bullets --- Remove Bullets from Inventory --- Activate Damage Dealer --- Change Bullet's Position --- Play Gun Sound --- Explosion Rigidbody --- Destroy Bullets.

In the Explosion Rigidbody here are the settings:
Actor is Target
Force mode is Force of type value with a value of 1000
Explosion Radius is type Value with a value of 10
Upwards Modifier is type Value with a value of 0
Explosion Position's Use Object is enable and the Actor is set to User.

In my enemy's Rigidbody component, I disable the Freeze Rotation XYZ.

I want to create an effect similar to if I shoot at an enemy and hit, the enemy will be push back a little. Am I missing something?
  • You need to disable Freeze Position and enable Freeze Rotation.
    Alternatively you can also use the Change Position step.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Oops, yeah I meant I disable the Freeze Position and enable the Freeze Rotation.
    It doesn't work at all, no matter if I put the Actor to Target or User.

    And I also try the Change Position as you mention and it won't work either. If I use the User as Actor, my character will be push back everything I shoot a gun, but I want the enemy to move back whenever I damage them. I try making the USER as target, but that does nothing.
  • What battle system are you using?

    E.g. in real time battles, the enemies are also always moving (e.g. through move AI or actions of their own), which can counteract your knockback ...
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ah, I'm using real time battles. So does that mean that I won't be able to do a knockback upon damage? Would be so cool if I could XD
  • edited April 2014
    I haven't been able to get this fully to work, but you can generally get there by using a None block in the battle AI to disable his moving toward you due to his ability, and also stop his movement. Then make him explode. When this happens he seems to ignore terrain collisions and keep flying forever, through the terrain and into oblivion, so i haven't figured that part out yet, but he does get pushed back if you turn off his battle AI and his move AI. You could try other ways to preventing him from moving (a Stop movement status) but when I tried I wasn't able to get this to work, but I didn' ttry too hard since he flies through the terrain :P

    Edit: I did some testing and it seems without a Move AI and Gravity enabled in rigid body the combatant falls through the terrain. I guess I'm not sure what's going on, but it seems disabling his move AI is making him not collide with the terrain.
    Post edited by Juryiel on
  • Without a collider, there is nothing that stops an object from falling through the ground - I think rigidbody and character controller aren't working together in that way.

    I'll take a look at knockbacks, there should be an easy way to achieve that, maybe an extra event step :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks for the info, Juryiel. Even if that didn't work, it gave me ideas for other things.
    And GiL, that would be fantastic!
  • GiL, I'll keep playing with it see if I can figure it out but if you do decide to add something simpler yourself that would be great :) in that case though don't forget the vertical component :)
Sign In or Register to comment.