Hello I am following a tutorial for a air hockey game and how do i make it so when the ball comes in contact with the barrier it bounces no matter how hard i hit it it bounces off. Since i am currently using bouncing 2d physics i need to apply force for it to bounce but i want it to bounce no matter the force. thank you for your help. i would appreciate a simple explanation since im new to unity. enter image description here
Asked
Active
Viewed 472 times
1 Answers
1
You can set a constant Rigid body.Velocity in the reflected direction with Vector3. Reflect.
Constan velocity set is my proposal according to the explanation " it bounces no matter how hard i hit it it bounces off ". For a more detailed behavior, details can be handled in the code to set the velocity accordingly. A more detailed explanation would be needed but with the real behavior of the disk in mind, I would reflect the rigidbody's direction on hit event and if the velocity vector module is smaller than some threshold, set a constant speed.

rustyBucketBay
- 4,320
- 3
- 17
- 47
-
Sorry like i said im new to unity can you explain it more simple pls – Kevinpro Hackfun Jul 08 '21 at 17:34
-
I think you need to try something out and get to the point where you can show some code in the question and explain where you get stuck with an expected outcome you are not getting, so that the problem is narrowed down. Good luck :) – rustyBucketBay Jul 08 '21 at 19:12