- Home /
Slow down object about to collide
Hi! I want to know if there is a way to slow down a 2d object that it's about to hit something, like a smooth landing. Animation is not an option in this case. My project just uses cubes that moves on x or y, there are no diagonal movements/collisions. Sorry if this question has already been made, I couldn't find it. Thanks!!
Answer by jeffreyrampineda · Nov 22, 2017 at 04:25 AM
Try adding Rigidbody2D into that 2d object and use Rigidbody2D.drag. Try creating a secondary gameObject that surrounds what the 2d object is about to hit and set that secondary gameObject's collider to isTrigger. Then add a script into that secondary gameObject OnTriggerEnter2D to set the Rigidbody2D.drag to some value of the 2d object that enters.
Your answer
Follow this Question
Related Questions
How do I make a collision detector for the parent which effects the children? 1 Answer
Set ContactFilter2d to not use child object's triggers. 2 Answers
Unity Physics Collision Execution Order Error? 1 Answer
Executing code on touching edges of a collider from the inside 0 Answers
Trigger is not executed 1 Answer