- Home /
Question by
peterbach · Mar 11, 2019 at 08:52 PM ·
rigidbody2daddforcebullettriggers
How Do I Make My Bullet Add Force To The Object It Hits?
I've been looking around for a few days now and I still haven't found an answer so I'll ask it myself, in unity 2d I have a bullet prefab that has a trigger collider on the front. what I want to do is when an object enters that trigger collider the bullet adds rigidbody force on to that object in the direction the bullet is travelling?
Comment
Answer by j04milan · Mar 11, 2019 at 09:38 PM
Save the object rigidbody your bullet collides with in a variable, then use the fuction AddforceAtPosition, check this short video https://m.youtube.com/watch?v=G8cePMSkALI