- Home /
Question by
hophoppoppop · Aug 15, 2015 at 03:55 AM ·
rigidbody2dvelocity
Make Object lookat velocity
Vector2 dir = transform.rigidbody2D.velocity;
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
I got this script from other forum. but when i attach it. the RigidBody2D.AddForce doesn't work. maybe someone can fix this?
i use addforce to pull player to a point.
Comment
Your answer
Follow this Question
Related Questions
Stuttering/jerky movement of kinematic rigidbody 2d moving by velocity in 2D game on iOS 0 Answers
Displaying the y value score,Displaying the score of the Y value 1 Answer
Make object stay inside circle 1 Answer
Jumping with Rigidbody.AddForce not working? 1 Answer
RigidBody velocity ends with weird floating value, when axis key is released. 3 Answers