Quantcast
Viewing latest article 4
Browse Latest Browse All 8

2D game - Sprite deformation when add frce

Hi. I created an image and added to it Collider, Rigidbody2D. Also I create script with function which called when pressing the space key and AddForce to this image. After when I start project and press Space key I saw that object start deformed. Whel it collision with other object Player very deformaed. It is deformed and stretched in width upwards. But when I set equal force for X and Y axis Player didn't deformed. For example transform.AddForce(500f, 3000f); // Deformed transform.AddForce(3000f, 3000f);// Not deformed ![alt text][1] Ball components ![alt text][2] Ball script with AddForce void Update () { if (Input.GetKeyDown(KeyCode.Space)) { Debug.Log("Add force"); GetComponent().AddForce(new Vector2(xForce, yForce)); } } What do to fix this problem? [1]: /storage/temp/82097-1.png [2]: /storage/temp/82098-1.png

Viewing latest article 4
Browse Latest Browse All 8

Trending Articles