D
D
Dimproks2019-04-07 19:24:43
Unity
Dimproks, 2019-04-07 19:24:43

How to reflect an object (fully elastic collision) in Unity?

Good day!
I ran into a problem while writing the game (I'm new to this). I want to create a generator that creates small balls and releases them in a certain direction. So, how to make it so that after hitting a collider (a wall, for example), they completely elastically rebound from it (keep their speed) and so that the angle of incidence of these balls is equal to the angle of reflection. I hope the question was formulated correctly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2019-04-07
@Dimproks

Colliders have a PHYSICAL MATERIAL property.
https://docs.unity3d.com/Manual/class-PhysicMateri...
the material itself has the properties of friction and elasticity.
Don't forget to set the material for both the object and the "wall" it will hit.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question