user14576281
user14576281

Reputation:

How to get rid of acceleration during bouncing ? (unity 2D)

I don't know if this is the correct therm, but I want to get rid of any kind of forces that could modify the speed of my object. Let me explain : the game is 2D top-down view and the character fires a bullet that bounces x amount of time, WITH CONSTANT SPEED. Everything works fine, but when the bullet bounces fast and many times, its speed increases.

Also, second problem: I have a rotating object and when the bullet hits it, its speed increases (which makes sense, but I would like to know if there is a way to delete this effect) .

enter image description here

enter image description here

I would like to know if there is a way to solve my issues.

Upvotes: 1

Views: 490

Answers (1)

Leoverload
Leoverload

Reputation: 1248

You need to check the material of the object for your first question (https://docs.unity3d.com/Manual/class-PhysicMaterial.html) you need to set Bounciness to 1 so it will maintain dame speed. If you set it to 0 there will be no bounce and probably you have a value bigger than 1 and so it's increasing.

In the second case it's all about the forces involving. The object bouncing on the rotating one is adding a force to that one. If you want to keep the second one with same rotation you could rotate it with a transform.Rotate and remove a Rigidbody or set it to static

Upvotes: 1

Related Questions