- Home /
Question by
Ashish Dwivedi · Jan 23, 2014 at 10:16 AM ·
2dtoolkit
How to get width and height of sprite object in meters while creating with unity 2d toolkit???
I created sprite object using unity 2d toolkit. Mesh is created automatically around the image but scaling remain 1 doesn't matter what is the size of image. I need exact information about scaling means how long it is in meters??
Comment
Answer by Franco-Marini · Apr 05, 2014 at 06:37 PM
1st- Add a BoxCollider2D to the sprite.
2nd- In-function code: BoxCollider2D MyCollider = GetComponent();
3rd- Get the info from:
MyCollider.size.x (equals witdh)
MyCollider.size.y (equals height)
Your answer
Follow this Question
Related Questions
Script Problems? 1 Answer
2dToolkit camera anchor + iTween move 0 Answers
Strange Rigidbody behaviour 0 Answers
Get a tk2dTextMesh text without styling 0 Answers
Track collider 2dToolkit 2 Answers