Author Topic: Projectiles and physics knockback  (Read 1466 times)

Offline RockinRyan

  • Member
  • *
  • Posts: 4
    • View Profile
Projectiles and physics knockback
« on: July 09, 2017, 08:36:01 am »
Hi There,

I'm trying to use a portion of 3DTD and in my project the bullets and bolts send my game objects flying off into space. It's hilarious at first observation, but tuning the mass settings and doing anything short of changing colliders into triggers doesn't seem to matter or help.

My question is - did you make all your enemies use triggers to avoid the projectile knockback from the physics engine?

Thank you,
Ryan

Offline Baroni

  • Administrator
  • *****
  • Posts: 1364
    • View Profile
Re: Projectiles and physics knockback
« Reply #1 on: July 09, 2017, 12:08:21 pm »
Hey Ryan,

yes, all projectile/enemy collision in this kit is handled via triggers. Both the projectiles and enemis have a RigidBody attached to them, but it is set to kinematic only, without gravity, basically for disabling the physics behavior. By default, physics such as knockbacks wouldn't work either way, because the movement script for enemies is using tweens on fixed path, so they can't leave their path or get "pushed away" (this would work with a pathfinding script, but with tweens the new path would need to be rebuild when kicked off-path).
« Last Edit: July 09, 2017, 12:09:57 pm by Baroni »

Bruening

  • Guest
Re: Projectiles and physics knockback
« Reply #2 on: May 23, 2018, 04:19:35 pm »
Hi Baroni, can you play around with the physics knockback and change how it works or is it set in stone, so to speak?

Offline Baroni

  • Administrator
  • *****
  • Posts: 1364
    • View Profile
Re: Projectiles and physics knockback
« Reply #3 on: May 23, 2018, 08:21:32 pm »
Bruening:

As I wrote in the last reply, there is no physics knockback, because enemies don't use gravity. You would need to rebuild the movement to work with gravity, which tweens aren't designed for.