Page 1 of 1

Bullet collision help

Posted: Sat Mar 16, 2013 6:14 pm
by needshelprendering
Hello, I am using a Raycast to determine if my bullets will hit an Entity. My goal would be to apply force exactly where the Raycast hits, and not the entire entity. Right mow I am altering the Linear Velocity. But, that simply moves the box. I tried ApplyImpulse too, but that does the same thing. I made a gif to show you how it currently acts. I would like the bullets to cause the entity to rotate and such. So for example, if I shoot a corner, the Entity will spin in that direction. I am sure it is fairly simple, I just cannot find out which one would work. Thank you.

Image

Re: Bullet collision help

Posted: Sat Mar 16, 2013 6:58 pm
by Norbo
Entity.ApplyImpulse is what you're looking for. For the impulse location, use the ray hit location instead of the center of the entity.

Re: Bullet collision help

Posted: Sat Mar 16, 2013 7:53 pm
by needshelprendering
Norbo wrote:Entity.ApplyImpulse is what you're looking for. For the impulse location, use the ray hit location instead of the center of the entity.
This worked perfectly, thank you very much!