- Home /
Question by
alternateemail1234512 · May 09, 2021 at 06:42 PM ·
vector3
Push Object in Opposite Direction of Collision
I have questions about above code
// calculate force vector
var force = transform.position - other.transform.position;
why would this line would give me direction of vector. I am assuming this line would subtract the origin point of collider minus point of contact on box collider right? if i subtract two terms why would it give me direction vector?
another question what is the purpose of this?
// normalize force vector to get direction only and trim magnitude
force.Normalize();
wouldn't this line of code cut down magnitude of force 1 so I really don't need line do I? I am just trying to get direction vector
Thank you so much
1-복사본.jpg
(27.4 kB)
Comment