Skip to main content

Point To Point

Point to point dimension is a simple type of measurement. It calculates the direct distance between two Vector3 positions.

  • When you run the void EzPointToPointDimension() by clicking on the button in your UI, the EzPointToPointDimension gameobject will be created under the StarterGO.
  • However, all of its children are invisible until you make the first click on an object that has a collider.
  • After that, while you haven't made the second click, the dimension measures the first click and the current mouse position (if the mouse hovers over an object with a collider).
  • Once you make the second click, your dimension will be added to the dimensionsList in the starter script and it's done.
  • If you select the EzPointToPointDimension gameobject under the StarterGO and take a look at the inspector, you can see that the dimension copied the parameters from the starter script inside itself.

Parameters

Point To Point Dimension Inspector

There are two types of parameters in all dimensions.

Some parameters are always individual, while others get their value from the ValueReference Component (which is the StarterGO script) until you mark IsIndividual.

For example, in this type of dimension, everything under the IsIndividual toggle (all parameters except ValueReference) can have its local value if you turn on this Boolean.

So, if you need to have control from another script on a dimension separately, you first need to turn on this option at the beginning. If you turn it off again, everything is fine, and the values will be set to your settings from the StarterGO script because each script carries the StarterGO script with itself in the ValueReference field.


Individuality

PointToPointDimension_IsIndividual

By turning on “IsIndividual”, we can have the same dimension type with different settings.


Dynamic Transform

IsDynamic_PointToPointDimension

There is another option named "Is Dynamic". If this option is set to True, the dimension will automatically update if the target objects undergo any transformations.



caution

If the dimension is not set as individual, it will be determined by the "IsDynamic" setting in the StarterScript > General section.



You can review other parameters in the ScriptingAPI/PointToPointDimension section.