transform.Translate to control a downside of moving objects, we can not achieve real physical force, collision bounce status

I wanted to realize a function of a bullet fired out, constant movement forward, a bounce in time come into contact with the walls of the
first author is already Bounciness 0.8 of Physic Material assigned to the bullets of the collider body
but the rebound is still unsuccessful , you can see the figure. Here Insert Picture Description
As shown above, the bullet on a blue wall has been stuck in it, will not be rebound
this reason I originally thought it was his rigidbody and collider set up a problem
but then found that no matter how the test is not successful
until a bit later output bullet after speed (see figure below)
Here Insert Picture Description
to think of it transform.Translate use to control the object moving
object will not have the speed, the situation would not have received more force
since there is no force that the collision object, how could rebound can be achieved it?
So then switch to
rb.velocity = transform.up * BulletSpeed; // attach a bullet velocity
Subsequently bullet hit the wall can achieve turnaround

Summary ': transform.Translate were able to achieve the object moves, but the real object and being the moving force so as to realize is different. Under initial conditions because bullets do not bounce bullet itself has no power and no speed at the same time, transform.Translate has controlled the bullet upward movement, and thus would have been stuck in the side wall

Released two original articles · won praise 0 · Views 17

Guess you like

Origin blog.csdn.net/qq_43233423/article/details/104676321