playMaker

Author Topic: playmaker physics  (Read 2054 times)

mallenroh

  • Playmaker Newbie
  • *
  • Posts: 32
playmaker physics
« on: January 12, 2014, 03:02:58 PM »
If I have a rigid body "bullet" that collides with a stationary rigid body gameobject, what is the best way to apply a force to the struck object that inherits the bullets trajectory?

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: playmaker physics
« Reply #1 on: January 12, 2014, 03:30:42 PM »
Odd. It should naturally be pushed by the bullet if they're both physical objects. (unless the stationary object is huge or heavy)
How are you moving the bullet? If it's a translate position it might not work since that's not a physical action. An addforce would work.

mallenroh

  • Playmaker Newbie
  • *
  • Posts: 32
Re: playmaker physics
« Reply #2 on: January 12, 2014, 05:18:13 PM »
I guess specifically I want to add a variable amount of force to the impact, along the approach vector of the bullet. There is some natural force that gets applied between the 2 rigid bodies, I just want to be able to apply more force along the angle of approach beyond the amount from the collision.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: playmaker physics
« Reply #3 on: January 13, 2014, 06:34:36 AM »
Hi,

 you can apply a force using the direction found in the collision info.

https://hutonggames.fogbugz.com/default.asp?W369

so watch for collision and then use that action to get the normal and that's your opposite direction.

One other way is to get the velocity of the bullet at the moment of impact, normalize it and multiply it with a force magnitue that will have the same effect.



 Bye,

 Jean