- Home /
Question by
Anonymou5 · Dec 13, 2016 at 05:03 PM ·
c#scripting problemobjectscalelocalscale
Object's localScale
I have a script that shows me what object i'm looking at. I would like to know that object's localScale.
For example if i'm looking at 1 x 1 x 1 object it would look like:
x = 1
y = 1
z = 1
I want to see it in script.
unityproblem.png
(3.7 kB)
Comment
Answer by Anonymou5 · Dec 13, 2016 at 05:24 PM
I know how to do it. I used this:
X = lookingAt.gameObject.GetComponent<Transform>().localScale.x;
Y = lookingAt.gameObject.GetComponent<Transform>().localScale.y;
Z = lookingAt.gameObject.GetComponent<Transform>().localScale.z;
Your answer
Follow this Question
Related Questions
How do i set a "object.max" scale ex.:: X axis ? 1 Answer
Object scale 1 Answer
How to translate object using script? 1 Answer
Distribute terrain in zones 3 Answers