- Home /
How would i go about comparing two transform scales
Hi. I need to compare the scale of two gameobjects and find out which one is greater. I tried using if (player.transform.localScale < NPC.transform.localScale) if (player.transform.localScale > NPC.transform.localScale) but you cant use that operator on vector3. Im not sure if im missing something obvious here but i cant seem to figure out how to do this. Any help is appreciated. Thanks.
You will have to compare the x,y and z scales individually since a case where x1>x2 but y1< y2 is possible
Answer by Aaqib_Zafar · Nov 08, 2018 at 05:13 AM
You can compare the magnitude of scale vector. "gameObject.transform.localScale.magnitude"
Your answer
Follow this Question
Related Questions
Why isn't my teleport on collision script working? 0 Answers
Why isn't my move on collision script working? 0 Answers
Multiple Raycasts & Vector3.Reflects in a row. How? 1 Answer
Get Y Rotation Between Two Vector3 Points 2 Answers
Calculating Scrolling GameObject x position scrolling pass another GameObject x postion (2D Game) 1 Answer