Looking at example code for mesh deformation in unity
https://answers.unity.com/questions/746673/sine-wave-mesh-deform-with-different-directions.html
And i see theyve used
public Transform Target1;
public Transform Target2;
void CalculateWaves ()
{
waves[0].Direction = Target1.position - transform.position;
waves[1].Direction = Target2.position - transform.position;
And i dont understand the difference between Target1.position and transform.position without any reference to an instance.
Arent they the same thing. And how does transform.position function without a reference.
Transform
, the class, is spelled with an uppercase T. When you see a lowercase ttransform
it's not referring to the class itself, but to a variable or property (generally one that's populated with an instance of theTransform
class - see jhocking's answer) \$\endgroup\$ – DMGregory♦ Oct 2 '18 at 18:36