I’m trying to make a Katamari style game, and so I need the player controller to be a certain size before exiting the scene. I can’t figure out how to check the transform’s scale to initiate the trigger.
Currently, Visual Studio does not like me using “localScale = Vector3” in this context.
Is my only option to move the exit trigger to a point only a certain size could reach? I haven’t fully decided if the player will be able to jump, so I don’t want the trigger to be accessed by jumping.
When doing comparison you must always do ==
Also, if you want to make a new Vector3 value, you need to use the word new
I suggest making a variable of type Vector3 before you do the if comparison to help keep things clear and then use that variable in your comparison instead.
There is no need for this part (unless you want to handle the floating point inaccuracy yourself with some custom amount). Vector3 overloads the == operator and accounts for the floating point inaccuracy.
See here in the documentation: https://docs.unity3d.com/ScriptReference/Vector3-operator_eq.html